Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / platform / x86 / intel_scu_pltdrv.c
blob56ec6ae4c824a28c4b5009b42edb50b23e3bc25c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Platform driver for the Intel SCU.
5 * Copyright (C) 2019, Intel Corporation
6 * Authors: Divya Sasidharan <divya.s.sasidharan@intel.com>
7 * Mika Westerberg <mika.westerberg@linux.intel.com>
8 * Rajmohan Mani <rajmohan.mani@intel.com>
9 */
11 #include <linux/err.h>
12 #include <linux/errno.h>
13 #include <linux/ioport.h>
14 #include <linux/mod_devicetable.h>
15 #include <linux/module.h>
16 #include <linux/platform_device.h>
18 #include <asm/intel_scu_ipc.h>
20 static int intel_scu_platform_probe(struct platform_device *pdev)
22 struct intel_scu_ipc_data scu_data = {};
23 struct intel_scu_ipc_dev *scu;
24 const struct resource *res;
26 scu_data.irq = platform_get_irq_optional(pdev, 0);
27 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
28 if (!res)
29 return -ENOMEM;
31 scu_data.mem = *res;
33 scu = devm_intel_scu_ipc_register(&pdev->dev, &scu_data);
34 if (IS_ERR(scu))
35 return PTR_ERR(scu);
37 platform_set_drvdata(pdev, scu);
38 return 0;
41 static const struct acpi_device_id intel_scu_acpi_ids[] = {
42 { "INTC1026" },
45 MODULE_DEVICE_TABLE(acpi, intel_scu_acpi_ids);
47 static struct platform_driver intel_scu_platform_driver = {
48 .probe = intel_scu_platform_probe,
49 .driver = {
50 .name = "intel_scu",
51 .acpi_match_table = intel_scu_acpi_ids,
54 module_platform_driver(intel_scu_platform_driver);
56 MODULE_AUTHOR("Divya Sasidharan <divya.s.sasidharan@intel.com>");
57 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com");
58 MODULE_AUTHOR("Rajmohan Mani <rajmohan.mani@intel.com>");
59 MODULE_DESCRIPTION("Intel SCU platform driver");
60 MODULE_LICENSE("GPL v2");