2 * Intel PCH/PCU SPI flash platform driver.
4 * Copyright (C) 2016, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/ioport.h>
13 #include <linux/module.h>
14 #include <linux/platform_device.h>
16 #include "intel-spi.h"
18 static int intel_spi_platform_probe(struct platform_device
*pdev
)
20 struct intel_spi_boardinfo
*info
;
21 struct intel_spi
*ispi
;
24 info
= dev_get_platdata(&pdev
->dev
);
28 mem
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
29 ispi
= intel_spi_probe(&pdev
->dev
, mem
, info
);
33 platform_set_drvdata(pdev
, ispi
);
37 static int intel_spi_platform_remove(struct platform_device
*pdev
)
39 struct intel_spi
*ispi
= platform_get_drvdata(pdev
);
41 return intel_spi_remove(ispi
);
44 static struct platform_driver intel_spi_platform_driver
= {
45 .probe
= intel_spi_platform_probe
,
46 .remove
= intel_spi_platform_remove
,
52 module_platform_driver(intel_spi_platform_driver
);
54 MODULE_DESCRIPTION("Intel PCH/PCU SPI flash platform driver");
55 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
56 MODULE_LICENSE("GPL v2");
57 MODULE_ALIAS("platform:intel-spi");