From: Al Stone al.stone@linaro.org
This patch adds in some essentially null drivers (for now) as placeholders. The intent is to eventually provide a sysfs interface that would allow the kernel developer to interact with GUFI and test out the various aspects of the interface.
Signed-off-by: Al Stone al.stone@linaro.org --- drivers/acpi/acpi_platform.c | 1 + drivers/gufi/gufi_acpi_test.c | 84 +++++++++++++++++++++++++++++++++++++++++++ drivers/gufi/gufi_of_test.c | 83 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 drivers/gufi/gufi_acpi_test.c create mode 100644 drivers/gufi/gufi_of_test.c
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 1359eda..dd83d5d 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -36,6 +36,7 @@ static const struct acpi_device_id acpi_platform_device_ids[] = { { "LNRO0007" }, /* armv8 pmu */ { "LNRO0009" }, /* vexpress-sysreg */ { "LNRO000A" }, /* uart-pl011 */ + { "LNRO000B" }, /* gufi-acpi-test */
{ } }; diff --git a/drivers/gufi/gufi_acpi_test.c b/drivers/gufi/gufi_acpi_test.c new file mode 100644 index 0000000..3536520 --- /dev/null +++ b/drivers/gufi/gufi_acpi_test.c @@ -0,0 +1,84 @@ +/* + * Grand Unified Firmware Interface -- test driver + * + * Copyright (C) 2013 Al Stone al.stone@linaro.org + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifdef CONFIG_GUFI + +#ifdef CONFIG_ACPI + +#include <linux/gufi.h> +#include <linux/module.h> +#include <linux/acpi.h> +#include <linux/platform_device.h> + +/* Platform Device */ + +static int gufi_acpi_probe(struct platform_device *pdev) +{ + pr_debug("entering gufi_acpi_probe\n"); + return -EINVAL; +} + +static int gufi_acpi_remove(struct platform_device *pdev) +{ + return -EINVAL; +} + +/* Platform Driver */ + +static struct acpi_device_id gufi_acpi_match[] = { + { "LNRO000B", }, + { } +}; +MODULE_DEVICE_TABLE(gufi, gufi_acpi_match); + +static struct platform_driver gufi_acpi_driver = { + .probe = gufi_acpi_probe, + .remove = gufi_acpi_remove, + .driver = { + .name = "gufi-acpi-test", + .owner = THIS_MODULE, + .acpi_match_table = gufi_acpi_match, + }, +}; + +static int __init gufi_acpi_init(void) +{ + return platform_driver_register(&gufi_acpi_driver); +} + +static void __init gufi_acpi_exit(void) +{ + platform_driver_unregister(&gufi_acpi_driver); +} + +module_init(gufi_acpi_init); +module_exit(gufi_acpi_exit); + +MODULE_AUTHOR("Al Stone al.stone@linaro.org"); +MODULE_DESCRIPTION("DT Test Driver for the Grand Unified Firmware Interface"); +MODULE_LICENSE("GPL"); + +#endif /* CONFIG_OF */ + +#endif /* CONFIG_GUFI */ diff --git a/drivers/gufi/gufi_of_test.c b/drivers/gufi/gufi_of_test.c new file mode 100644 index 0000000..60ebc71 --- /dev/null +++ b/drivers/gufi/gufi_of_test.c @@ -0,0 +1,83 @@ +/* + * Grand Unified Firmware Interface -- test driver + * + * Copyright (C) 2013 Al Stone al.stone@linaro.org + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#ifdef CONFIG_GUFI + +#ifdef CONFIG_OF + +#include <linux/gufi.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/platform_device.h> + +/* Platform Device */ + +static int gufi_of_probe(struct platform_device *pdev) +{ + return -EINVAL; +} + +static int gufi_of_remove(struct platform_device *pdev) +{ + return -EINVAL; +} + +/* Platform Driver */ + +static struct of_device_id gufi_of_match[] = { + { .compatible = "gufi,of", }, + { } +}; +MODULE_DEVICE_TABLE(gufi, gufi_of_match); + +static struct platform_driver gufi_of_driver = { + .probe = gufi_of_probe, + .remove = gufi_of_remove, + .driver = { + .name = "gufi-of-test", + .owner = THIS_MODULE, + .of_match_table = gufi_of_match, + }, +}; + +static int __init gufi_of_init(void) +{ + return platform_driver_register(&gufi_of_driver); +} + +static void __init gufi_of_exit(void) +{ + platform_driver_unregister(&gufi_of_driver); +} + +module_init(gufi_of_init); +module_exit(gufi_of_exit); + +MODULE_AUTHOR("Al Stone al.stone@linaro.org"); +MODULE_DESCRIPTION("DT Test Driver for the Grand Unified Firmware Interface"); +MODULE_LICENSE("GPL"); + +#endif /* CONFIG_OF */ + +#endif /* CONFIG_GUFI */