/*
* MTD structure for E3 (Delta)
*/
-
struct ams_delta_nand {
struct nand_chip nand_chip;
struct gpio_desc *gpiod_rdy;
.size = 3 * SZ_256K },
};
-static void ams_delta_io_write(struct ams_delta_nand *priv, u_char byte)
+static void ams_delta_io_write(struct ams_delta_nand *priv, u8 byte)
{
writew(byte, priv->io_base + OMAP_MPUIO_OUTPUT);
gpiod_set_value(priv->gpiod_nwe, 0);
gpiod_set_value(priv->gpiod_nwe, 1);
}
-static u_char ams_delta_io_read(struct ams_delta_nand *priv)
+static u8 ams_delta_io_read(struct ams_delta_nand *priv)
{
- u_char res;
+ u8 res;
gpiod_set_value(priv->gpiod_nre, 0);
ndelay(40);
priv->data_in = in;
}
-static void ams_delta_write_buf(struct ams_delta_nand *priv, const u_char *buf,
+static void ams_delta_write_buf(struct ams_delta_nand *priv, const u8 *buf,
int len)
{
int i;
ams_delta_io_write(priv, buf[i]);
}
-static void ams_delta_read_buf(struct ams_delta_nand *priv, u_char *buf,
- int len)
+static void ams_delta_read_buf(struct ams_delta_nand *priv, u8 *buf, int len)
{
int i;
return 0;
for (instr = op->instrs; instr < op->instrs + op->ninstrs; instr++) {
-
switch (instr->type) {
case NAND_OP_CMD_INSTR:
gpiod_set_value(priv->gpiod_cle, 1);
return ret;
}
-
/*
* Main initialization routine
*/
/* Allocate memory for MTD device structure and private data */
priv = devm_kzalloc(&pdev->dev, sizeof(struct ams_delta_nand),
GFP_KERNEL);
- if (!priv) {
- pr_warn("Unable to allocate E3 NAND MTD device structure.\n");
+ if (!priv)
return -ENOMEM;
- }
+
this = &priv->nand_chip;
mtd = nand_to_mtd(this);
* it should have been already requested from the
* gpio-omap driver and requesting it again would fail.
*/
-
io_base = ioremap(res->start, resource_size(res));
- if (io_base == NULL) {
+ if (!io_base) {
dev_err(&pdev->dev, "ioremap failed\n");
err = -EIO;
goto out_free;
priv->io_base = io_base;
nand_set_controller_data(this, priv);
- /* Set address of NAND IO lines */
this->select_chip = ams_delta_select_chip;
this->exec_op = ams_delta_exec_op;