diff options
Diffstat (limited to 'drivers/spi/imx_spi.c')
-rw-r--r-- | drivers/spi/imx_spi.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c index 46e8955abb..5310a2715d 100644 --- a/drivers/spi/imx_spi.c +++ b/drivers/spi/imx_spi.c @@ -1,17 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2008 Sascha Hauer, Pengutronix - * - * 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. - * - * */ #include <common.h> @@ -26,8 +15,8 @@ #include <malloc.h> #include <gpio.h> #include <of_gpio.h> -#include <mach/spi.h> -#include <mach/generic.h> +#include <mach/imx/spi.h> +#include <mach/imx/generic.h> #include <linux/clk.h> #include <linux/err.h> #include <clock.h> @@ -573,13 +562,13 @@ static __maybe_unused struct spi_imx_devtype_data spi_imx_devtype_data_2_3 = { static int imx_spi_dt_probe(struct imx_spi *imx) { - struct device_node *node = imx->master.dev->device_node; + struct device_node *node = imx->master.dev->of_node; int i; if (!node) return -ENODEV; - imx->master.num_chipselect = of_gpio_named_count(node, "cs-gpios"); + imx->master.num_chipselect = of_gpio_count_csgpios(node); imx->cs_array = xzalloc(sizeof(u32) * imx->master.num_chipselect); for (i = 0; i < imx->master.num_chipselect; i++) @@ -588,7 +577,7 @@ static int imx_spi_dt_probe(struct imx_spi *imx) return 0; } -static int imx_spi_probe(struct device_d *dev) +static int imx_spi_probe(struct device *dev) { struct resource *iores; struct spi_master *master; @@ -614,7 +603,7 @@ static int imx_spi_probe(struct device_d *dev) master->num_chipselect = pdata->num_chipselect; imx->cs_array = pdata->chipselect; } else if (IS_ENABLED(CONFIG_OFDEVICE)) { - ret = of_alias_get_id(dev->device_node, "spi"); + ret = of_alias_get_id(dev->of_node, "spi"); if (ret < 0) goto err_free; master->bus_num = ret; @@ -673,11 +662,16 @@ static __maybe_unused struct of_device_id imx_spi_dt_ids[] = { .compatible = "fsl,imx51-ecspi", .data = &spi_imx_devtype_data_2_3, }, + { + .compatible = "fsl,imx6ul-ecspi", + .data = &spi_imx_devtype_data_2_3, + }, #endif { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, imx_spi_dt_ids); static struct platform_device_id imx_spi_ids[] = { #if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_0_0) @@ -703,7 +697,7 @@ static struct platform_device_id imx_spi_ids[] = { } }; -static struct driver_d imx_spi_driver = { +static struct driver imx_spi_driver = { .name = "imx_spi", .probe = imx_spi_probe, .of_compatible = DRV_OF_COMPAT(imx_spi_dt_ids), |