]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/tegra_nand.c
Merge branch 'master' of git://git.denx.de/u-boot-fdt
[u-boot] / drivers / mtd / nand / tegra_nand.c
index 6afbec61ee2c506904e11421b1ce9176ed9a168f..b660f3b20662dfbb427dd2770765d2acd1f6a089 100644 (file)
@@ -4,23 +4,7 @@
  * (C) Copyright 2006 Detlev Zundel, dzu@denx.de
  * (C) Copyright 2006 DENX Software Engineering
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -95,7 +79,7 @@ enum {
 struct fdt_nand {
        struct nand_ctlr *reg;
        int enabled;            /* 1 to enable, 0 to disable */
-       struct fdt_gpio_state wp_gpio;  /* write-protect GPIO */
+       struct gpio_desc wp_gpio;       /* write-protect GPIO */
        s32 width;              /* bit width, normally 8 */
        u32 timing[FDT_NAND_TIMING_COUNT];
 };
@@ -961,8 +945,8 @@ static int fdt_decode_nand(const void *blob, int node, struct fdt_nand *config)
        config->reg = (struct nand_ctlr *)fdtdec_get_addr(blob, node, "reg");
        config->enabled = fdtdec_get_is_enabled(blob, node);
        config->width = fdtdec_get_int(blob, node, "nvidia,nand-width", 8);
-       err = fdtdec_decode_gpio(blob, node, "nvidia,wp-gpios",
-                                &config->wp_gpio);
+       err = gpio_request_by_name_nodev(blob, node, "nvidia,wp-gpios", 0,
+                                &config->wp_gpio, GPIOD_IS_OUT);
        if (err)
                return err;
        err = fdtdec_get_int_array(blob, node, "nvidia,timing",
@@ -1025,8 +1009,7 @@ int tegra_nand_init(struct nand_chip *nand, int devnum)
        /* Adjust timing for NAND device */
        setup_timing(config->timing, info->reg);
 
-       fdtdec_setup_gpio(&config->wp_gpio);
-       gpio_direction_output(config->wp_gpio.gpio, 1);
+       dm_gpio_set_value(&config->wp_gpio, 1);
 
        our_mtd = &nand_info[devnum];
        our_mtd->priv = nand;