intel_scu_pltdrv.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Platform driver for the Intel SCU.
  4. *
  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. */
  10. #include <linux/err.h>
  11. #include <linux/errno.h>
  12. #include <linux/ioport.h>
  13. #include <linux/mod_devicetable.h>
  14. #include <linux/module.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/platform_data/x86/intel_scu_ipc.h>
  17. static int intel_scu_platform_probe(struct platform_device *pdev)
  18. {
  19. struct intel_scu_ipc_data scu_data = {};
  20. struct intel_scu_ipc_dev *scu;
  21. const struct resource *res;
  22. scu_data.irq = platform_get_irq_optional(pdev, 0);
  23. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  24. if (!res)
  25. return -ENOMEM;
  26. scu_data.mem = *res;
  27. scu = devm_intel_scu_ipc_register(&pdev->dev, &scu_data);
  28. if (IS_ERR(scu))
  29. return PTR_ERR(scu);
  30. platform_set_drvdata(pdev, scu);
  31. return 0;
  32. }
  33. static const struct acpi_device_id intel_scu_acpi_ids[] = {
  34. { "INTC1026" },
  35. {}
  36. };
  37. MODULE_DEVICE_TABLE(acpi, intel_scu_acpi_ids);
  38. static struct platform_driver intel_scu_platform_driver = {
  39. .probe = intel_scu_platform_probe,
  40. .driver = {
  41. .name = "intel_scu",
  42. .acpi_match_table = intel_scu_acpi_ids,
  43. },
  44. };
  45. module_platform_driver(intel_scu_platform_driver);
  46. MODULE_AUTHOR("Divya Sasidharan <divya.s.sasidharan@intel.com>");
  47. MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com");
  48. MODULE_AUTHOR("Rajmohan Mani <rajmohan.mani@intel.com>");
  49. MODULE_DESCRIPTION("Intel SCU platform driver");
  50. MODULE_LICENSE("GPL v2");