Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 1 | /* |
| 2 | * drivers/mtd/nand/gpio.c |
| 3 | * |
| 4 | * Updated, and converted to generic GPIO based driver by Russell King. |
| 5 | * |
| 6 | * Written by Ben Dooks <ben@simtec.co.uk> |
| 7 | * Based on 2.4 version by Mark Whittaker |
| 8 | * |
| 9 | * © 2004 Simtec Electronics |
| 10 | * |
Gerhard Sittig | c9d79c4 | 2014-08-05 10:37:26 +0200 | [diff] [blame] | 11 | * Device driver for NAND flash that uses a memory mapped interface to |
| 12 | * read/write the NAND commands and data, and GPIO pins for control signals |
| 13 | * (the DT binding refers to this as "GPIO assisted NAND flash") |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License version 2 as |
| 17 | * published by the Free Software Foundation. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <linux/kernel.h> |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 22 | #include <linux/err.h> |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 23 | #include <linux/slab.h> |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/gpio.h> |
| 27 | #include <linux/io.h> |
| 28 | #include <linux/mtd/mtd.h> |
| 29 | #include <linux/mtd/nand.h> |
| 30 | #include <linux/mtd/partitions.h> |
| 31 | #include <linux/mtd/nand-gpio.h> |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 32 | #include <linux/of.h> |
| 33 | #include <linux/of_address.h> |
| 34 | #include <linux/of_gpio.h> |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 35 | |
| 36 | struct gpiomtd { |
| 37 | void __iomem *io_sync; |
| 38 | struct mtd_info mtd_info; |
| 39 | struct nand_chip nand_chip; |
| 40 | struct gpio_nand_platdata plat; |
| 41 | }; |
| 42 | |
| 43 | #define gpio_nand_getpriv(x) container_of(x, struct gpiomtd, mtd_info) |
| 44 | |
| 45 | |
| 46 | #ifdef CONFIG_ARM |
| 47 | /* gpio_nand_dosync() |
| 48 | * |
| 49 | * Make sure the GPIO state changes occur in-order with writes to NAND |
| 50 | * memory region. |
| 51 | * Needed on PXA due to bus-reordering within the SoC itself (see section on |
| 52 | * I/O ordering in PXA manual (section 2.3, p35) |
| 53 | */ |
| 54 | static void gpio_nand_dosync(struct gpiomtd *gpiomtd) |
| 55 | { |
| 56 | unsigned long tmp; |
| 57 | |
| 58 | if (gpiomtd->io_sync) { |
| 59 | /* |
| 60 | * Linux memory barriers don't cater for what's required here. |
| 61 | * What's required is what's here - a read from a separate |
| 62 | * region with a dependency on that read. |
| 63 | */ |
| 64 | tmp = readl(gpiomtd->io_sync); |
| 65 | asm volatile("mov %1, %0\n" : "=r" (tmp) : "r" (tmp)); |
| 66 | } |
| 67 | } |
| 68 | #else |
| 69 | static inline void gpio_nand_dosync(struct gpiomtd *gpiomtd) {} |
| 70 | #endif |
| 71 | |
| 72 | static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
| 73 | { |
| 74 | struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); |
| 75 | |
| 76 | gpio_nand_dosync(gpiomtd); |
| 77 | |
| 78 | if (ctrl & NAND_CTRL_CHANGE) { |
| 79 | gpio_set_value(gpiomtd->plat.gpio_nce, !(ctrl & NAND_NCE)); |
| 80 | gpio_set_value(gpiomtd->plat.gpio_cle, !!(ctrl & NAND_CLE)); |
| 81 | gpio_set_value(gpiomtd->plat.gpio_ale, !!(ctrl & NAND_ALE)); |
| 82 | gpio_nand_dosync(gpiomtd); |
| 83 | } |
| 84 | if (cmd == NAND_CMD_NONE) |
| 85 | return; |
| 86 | |
| 87 | writeb(cmd, gpiomtd->nand_chip.IO_ADDR_W); |
| 88 | gpio_nand_dosync(gpiomtd); |
| 89 | } |
| 90 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 91 | static int gpio_nand_devready(struct mtd_info *mtd) |
| 92 | { |
| 93 | struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); |
Alexander Shiyan | 18afbc5 | 2012-10-17 10:08:27 +0400 | [diff] [blame] | 94 | |
Alexander Shiyan | c85d32d5 | 2013-05-06 17:53:49 +0400 | [diff] [blame] | 95 | return gpio_get_value(gpiomtd->plat.gpio_rdy); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 96 | } |
| 97 | |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 98 | #ifdef CONFIG_OF |
| 99 | static const struct of_device_id gpio_nand_id_table[] = { |
| 100 | { .compatible = "gpio-control-nand" }, |
| 101 | {} |
| 102 | }; |
| 103 | MODULE_DEVICE_TABLE(of, gpio_nand_id_table); |
| 104 | |
| 105 | static int gpio_nand_get_config_of(const struct device *dev, |
| 106 | struct gpio_nand_platdata *plat) |
| 107 | { |
| 108 | u32 val; |
| 109 | |
Alexander Shiyan | ee4f366 | 2013-05-06 17:53:50 +0400 | [diff] [blame] | 110 | if (!dev->of_node) |
| 111 | return -ENODEV; |
| 112 | |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 113 | if (!of_property_read_u32(dev->of_node, "bank-width", &val)) { |
| 114 | if (val == 2) { |
| 115 | plat->options |= NAND_BUSWIDTH_16; |
| 116 | } else if (val != 1) { |
| 117 | dev_err(dev, "invalid bank-width %u\n", val); |
| 118 | return -EINVAL; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | plat->gpio_rdy = of_get_gpio(dev->of_node, 0); |
| 123 | plat->gpio_nce = of_get_gpio(dev->of_node, 1); |
| 124 | plat->gpio_ale = of_get_gpio(dev->of_node, 2); |
| 125 | plat->gpio_cle = of_get_gpio(dev->of_node, 3); |
| 126 | plat->gpio_nwp = of_get_gpio(dev->of_node, 4); |
| 127 | |
| 128 | if (!of_property_read_u32(dev->of_node, "chip-delay", &val)) |
| 129 | plat->chip_delay = val; |
| 130 | |
| 131 | return 0; |
| 132 | } |
| 133 | |
| 134 | static struct resource *gpio_nand_get_io_sync_of(struct platform_device *pdev) |
| 135 | { |
Brian Norris | 103cdd8 | 2013-12-13 21:19:58 -0800 | [diff] [blame] | 136 | struct resource *r; |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 137 | u64 addr; |
| 138 | |
Brian Norris | 103cdd8 | 2013-12-13 21:19:58 -0800 | [diff] [blame] | 139 | if (of_property_read_u64(pdev->dev.of_node, |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 140 | "gpio-control-nand,io-sync-reg", &addr)) |
| 141 | return NULL; |
| 142 | |
Brian Norris | 103cdd8 | 2013-12-13 21:19:58 -0800 | [diff] [blame] | 143 | r = devm_kzalloc(&pdev->dev, sizeof(*r), GFP_KERNEL); |
| 144 | if (!r) |
| 145 | return NULL; |
| 146 | |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 147 | r->start = addr; |
| 148 | r->end = r->start + 0x3; |
| 149 | r->flags = IORESOURCE_MEM; |
| 150 | |
| 151 | return r; |
| 152 | } |
| 153 | #else /* CONFIG_OF */ |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 154 | static inline int gpio_nand_get_config_of(const struct device *dev, |
| 155 | struct gpio_nand_platdata *plat) |
| 156 | { |
| 157 | return -ENOSYS; |
| 158 | } |
| 159 | |
| 160 | static inline struct resource * |
| 161 | gpio_nand_get_io_sync_of(struct platform_device *pdev) |
| 162 | { |
| 163 | return NULL; |
| 164 | } |
| 165 | #endif /* CONFIG_OF */ |
| 166 | |
| 167 | static inline int gpio_nand_get_config(const struct device *dev, |
| 168 | struct gpio_nand_platdata *plat) |
| 169 | { |
| 170 | int ret = gpio_nand_get_config_of(dev, plat); |
| 171 | |
| 172 | if (!ret) |
| 173 | return ret; |
| 174 | |
Jingoo Han | 453810b | 2013-07-30 17:18:33 +0900 | [diff] [blame] | 175 | if (dev_get_platdata(dev)) { |
| 176 | memcpy(plat, dev_get_platdata(dev), sizeof(*plat)); |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 177 | return 0; |
| 178 | } |
| 179 | |
| 180 | return -EINVAL; |
| 181 | } |
| 182 | |
| 183 | static inline struct resource * |
| 184 | gpio_nand_get_io_sync(struct platform_device *pdev) |
| 185 | { |
| 186 | struct resource *r = gpio_nand_get_io_sync_of(pdev); |
| 187 | |
| 188 | if (r) |
| 189 | return r; |
| 190 | |
| 191 | return platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 192 | } |
| 193 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 194 | static int gpio_nand_remove(struct platform_device *pdev) |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 195 | { |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 196 | struct gpiomtd *gpiomtd = platform_get_drvdata(pdev); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 197 | |
| 198 | nand_release(&gpiomtd->mtd_info); |
| 199 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 200 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) |
| 201 | gpio_set_value(gpiomtd->plat.gpio_nwp, 0); |
| 202 | gpio_set_value(gpiomtd->plat.gpio_nce, 1); |
| 203 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 204 | return 0; |
| 205 | } |
| 206 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 207 | static int gpio_nand_probe(struct platform_device *pdev) |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 208 | { |
| 209 | struct gpiomtd *gpiomtd; |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 210 | struct nand_chip *chip; |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 211 | struct resource *res; |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 212 | int ret = 0; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 213 | |
Jingoo Han | 453810b | 2013-07-30 17:18:33 +0900 | [diff] [blame] | 214 | if (!pdev->dev.of_node && !dev_get_platdata(&pdev->dev)) |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 215 | return -EINVAL; |
| 216 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 217 | gpiomtd = devm_kzalloc(&pdev->dev, sizeof(*gpiomtd), GFP_KERNEL); |
Jingoo Han | 24e9971 | 2013-12-26 12:17:42 +0900 | [diff] [blame] | 218 | if (!gpiomtd) |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 219 | return -ENOMEM; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 220 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 221 | chip = &gpiomtd->nand_chip; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 222 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 223 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 224 | chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res); |
| 225 | if (IS_ERR(chip->IO_ADDR_R)) |
| 226 | return PTR_ERR(chip->IO_ADDR_R); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 227 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 228 | res = gpio_nand_get_io_sync(pdev); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 229 | if (res) { |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 230 | gpiomtd->io_sync = devm_ioremap_resource(&pdev->dev, res); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 231 | if (IS_ERR(gpiomtd->io_sync)) |
| 232 | return PTR_ERR(gpiomtd->io_sync); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 233 | } |
| 234 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 235 | ret = gpio_nand_get_config(&pdev->dev, &gpiomtd->plat); |
Jamie Iles | 775c3220 | 2011-12-18 10:00:49 +0000 | [diff] [blame] | 236 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 237 | return ret; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 238 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 239 | ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nce, "NAND NCE"); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 240 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 241 | return ret; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 242 | gpio_direction_output(gpiomtd->plat.gpio_nce, 1); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 243 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 244 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) { |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 245 | ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_nwp, |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 246 | "NAND NWP"); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 247 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 248 | return ret; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 249 | } |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 250 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 251 | ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_ale, "NAND ALE"); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 252 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 253 | return ret; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 254 | gpio_direction_output(gpiomtd->plat.gpio_ale, 0); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 255 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 256 | ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_cle, "NAND CLE"); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 257 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 258 | return ret; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 259 | gpio_direction_output(gpiomtd->plat.gpio_cle, 0); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 260 | |
Alexander Shiyan | 18afbc5 | 2012-10-17 10:08:27 +0400 | [diff] [blame] | 261 | if (gpio_is_valid(gpiomtd->plat.gpio_rdy)) { |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 262 | ret = devm_gpio_request(&pdev->dev, gpiomtd->plat.gpio_rdy, |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 263 | "NAND RDY"); |
Alexander Shiyan | 18afbc5 | 2012-10-17 10:08:27 +0400 | [diff] [blame] | 264 | if (ret) |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 265 | return ret; |
Alexander Shiyan | 18afbc5 | 2012-10-17 10:08:27 +0400 | [diff] [blame] | 266 | gpio_direction_input(gpiomtd->plat.gpio_rdy); |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 267 | chip->dev_ready = gpio_nand_devready; |
Alexander Shiyan | 18afbc5 | 2012-10-17 10:08:27 +0400 | [diff] [blame] | 268 | } |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 269 | |
Brian Norris | a61ae81 | 2015-10-30 20:33:25 -0700 | [diff] [blame^] | 270 | nand_set_flash_node(chip, pdev->dev.of_node); |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 271 | chip->IO_ADDR_W = chip->IO_ADDR_R; |
| 272 | chip->ecc.mode = NAND_ECC_SOFT; |
| 273 | chip->options = gpiomtd->plat.options; |
| 274 | chip->chip_delay = gpiomtd->plat.chip_delay; |
| 275 | chip->cmd_ctrl = gpio_nand_cmd_ctrl; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 276 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 277 | gpiomtd->mtd_info.priv = chip; |
Frans Klaver | e6c6c28 | 2015-06-10 22:38:48 +0200 | [diff] [blame] | 278 | gpiomtd->mtd_info.dev.parent = &pdev->dev; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 279 | |
Alexander Shiyan | f8e81c2 | 2013-05-06 17:53:53 +0400 | [diff] [blame] | 280 | platform_set_drvdata(pdev, gpiomtd); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 281 | |
| 282 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) |
| 283 | gpio_direction_output(gpiomtd->plat.gpio_nwp, 1); |
| 284 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 285 | if (nand_scan(&gpiomtd->mtd_info, 1)) { |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 286 | ret = -ENXIO; |
| 287 | goto err_wp; |
| 288 | } |
| 289 | |
| 290 | if (gpiomtd->plat.adjust_parts) |
| 291 | gpiomtd->plat.adjust_parts(&gpiomtd->plat, |
| 292 | gpiomtd->mtd_info.size); |
| 293 | |
Brian Norris | a61ae81 | 2015-10-30 20:33:25 -0700 | [diff] [blame^] | 294 | ret = mtd_device_register(&gpiomtd->mtd_info, gpiomtd->plat.parts, |
| 295 | gpiomtd->plat.num_parts); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 296 | if (!ret) |
| 297 | return 0; |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 298 | |
| 299 | err_wp: |
| 300 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) |
| 301 | gpio_set_value(gpiomtd->plat.gpio_nwp, 0); |
Alexander Shiyan | 283df42 | 2013-05-06 17:53:48 +0400 | [diff] [blame] | 302 | |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 303 | return ret; |
| 304 | } |
| 305 | |
| 306 | static struct platform_driver gpio_nand_driver = { |
| 307 | .probe = gpio_nand_probe, |
| 308 | .remove = gpio_nand_remove, |
| 309 | .driver = { |
| 310 | .name = "gpio-nand", |
Sachin Kamat | b57d43f | 2013-03-14 15:37:03 +0530 | [diff] [blame] | 311 | .of_match_table = of_match_ptr(gpio_nand_id_table), |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 312 | }, |
| 313 | }; |
| 314 | |
Sachin Kamat | 2fe87ae | 2012-09-05 15:31:32 +0530 | [diff] [blame] | 315 | module_platform_driver(gpio_nand_driver); |
Mike Rapoport | aaf7ea2 | 2008-10-15 08:38:49 +0200 | [diff] [blame] | 316 | |
| 317 | MODULE_LICENSE("GPL"); |
| 318 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
| 319 | MODULE_DESCRIPTION("GPIO NAND Driver"); |