Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Platform driver for the Intel SCU.
0004  *
0005  * Copyright (C) 2019, Intel Corporation
0006  * Authors: Divya Sasidharan <divya.s.sasidharan@intel.com>
0007  *      Mika Westerberg <mika.westerberg@linux.intel.com>
0008  *      Rajmohan Mani <rajmohan.mani@intel.com>
0009  */
0010 
0011 #include <linux/err.h>
0012 #include <linux/errno.h>
0013 #include <linux/ioport.h>
0014 #include <linux/mod_devicetable.h>
0015 #include <linux/module.h>
0016 #include <linux/platform_device.h>
0017 
0018 #include <asm/intel_scu_ipc.h>
0019 
0020 static int intel_scu_platform_probe(struct platform_device *pdev)
0021 {
0022     struct intel_scu_ipc_data scu_data = {};
0023     struct intel_scu_ipc_dev *scu;
0024     const struct resource *res;
0025 
0026     scu_data.irq = platform_get_irq_optional(pdev, 0);
0027     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
0028     if (!res)
0029         return -ENOMEM;
0030 
0031     scu_data.mem = *res;
0032 
0033     scu = devm_intel_scu_ipc_register(&pdev->dev, &scu_data);
0034     if (IS_ERR(scu))
0035         return PTR_ERR(scu);
0036 
0037     platform_set_drvdata(pdev, scu);
0038     return 0;
0039 }
0040 
0041 static const struct acpi_device_id intel_scu_acpi_ids[] = {
0042     { "INTC1026" },
0043     {}
0044 };
0045 MODULE_DEVICE_TABLE(acpi, intel_scu_acpi_ids);
0046 
0047 static struct platform_driver intel_scu_platform_driver = {
0048     .probe = intel_scu_platform_probe,
0049     .driver = {
0050         .name = "intel_scu",
0051         .acpi_match_table = intel_scu_acpi_ids,
0052     },
0053 };
0054 module_platform_driver(intel_scu_platform_driver);
0055 
0056 MODULE_AUTHOR("Divya Sasidharan <divya.s.sasidharan@intel.com>");
0057 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com");
0058 MODULE_AUTHOR("Rajmohan Mani <rajmohan.mani@intel.com>");
0059 MODULE_DESCRIPTION("Intel SCU platform driver");
0060 MODULE_LICENSE("GPL v2");