mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
e23e5a05d1
The preferred way to implement SPI-NOR controller drivers is through SPI subsubsystem utilizing the SPI MEM core functions. This converts the Intel SPI flash controller driver over the SPI MEM by moving the driver from SPI-NOR subsystem to SPI subsystem and in one go make it use the SPI MEM functions. The driver name will be changed from intel-spi to spi-intel to match the convention used in the SPI subsystem. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mauro Lima <mauro.lima@eclypsium.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20220209122706.42439-3-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
40 lines
978 B
C
40 lines
978 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Intel PCH/PCU SPI flash platform driver.
|
|
*
|
|
* Copyright (C) 2016 - 2022, Intel Corporation
|
|
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/platform_device.h>
|
|
|
|
#include "spi-intel.h"
|
|
|
|
static int intel_spi_platform_probe(struct platform_device *pdev)
|
|
{
|
|
struct intel_spi_boardinfo *info;
|
|
struct resource *mem;
|
|
|
|
info = dev_get_platdata(&pdev->dev);
|
|
if (!info)
|
|
return -EINVAL;
|
|
|
|
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
return intel_spi_probe(&pdev->dev, mem, info);
|
|
}
|
|
|
|
static struct platform_driver intel_spi_platform_driver = {
|
|
.probe = intel_spi_platform_probe,
|
|
.driver = {
|
|
.name = "intel-spi",
|
|
},
|
|
};
|
|
|
|
module_platform_driver(intel_spi_platform_driver);
|
|
|
|
MODULE_DESCRIPTION("Intel PCH/PCU SPI flash platform driver");
|
|
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
|
|
MODULE_LICENSE("GPL v2");
|
|
MODULE_ALIAS("platform:intel-spi");
|