diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-07-31 16:05:44 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-07-31 16:05:44 +0200 |
commit | 17ffe3a0fded309449e8bf201ad70358f3d52772 (patch) | |
tree | f3b5e5abc181dd088347e4b374851a8787600489 /drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c | |
parent | d4e695c016e0d5e15e91c7570ac4eef401b5c771 (diff) | |
parent | c56beff2037549c951042d178de75e535818a98a (diff) | |
download | linux-17ffe3a0fded309449e8bf201ad70358f3d52772.tar.gz linux-17ffe3a0fded309449e8bf201ad70358f3d52772.tar.bz2 linux-17ffe3a0fded309449e8bf201ad70358f3d52772.zip |
Merge tag 'ib-pdx86-simatic-v6.6-2' into review-hans
Immutable branch between pdx86 simatic branch and LED due for the v6.6 merge window
ib-pdx86-simatic-v6.6-2: v6.5-rc1 + ib-pdx86-simatic-v6.6 +
more recent pdx86 simatic-ipc patches for merging into
the LED subsystem for v6.6.
Diffstat (limited to 'drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c')
-rw-r--r-- | drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c new file mode 100644 index 000000000000..607d033911a2 --- /dev/null +++ b/drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Siemens SIMATIC IPC driver for CMOS battery monitoring + * + * Copyright (c) Siemens AG, 2023 + * + * Authors: + * Henning Schild <henning.schild@siemens.com> + */ + +#include <linux/gpio/machine.h> +#include <linux/gpio/consumer.h> +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/platform_device.h> + +#include "simatic-ipc-batt.h" + +static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_21a = { + .table = { + GPIO_LOOKUP_IDX("INTC1020:04", 18, NULL, 0, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("INTC1020:04", 19, NULL, 1, GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("INTC1020:01", 66, NULL, 2, GPIO_ACTIVE_HIGH), + {} /* Terminating entry */ + }, +}; + +static int simatic_ipc_batt_elkhartlake_remove(struct platform_device *pdev) +{ + return simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_21a); +} + +static int simatic_ipc_batt_elkhartlake_probe(struct platform_device *pdev) +{ + return simatic_ipc_batt_probe(pdev, &simatic_ipc_batt_gpio_table_bx_21a); +} + +static struct platform_driver simatic_ipc_batt_driver = { + .probe = simatic_ipc_batt_elkhartlake_probe, + .remove = simatic_ipc_batt_elkhartlake_remove, + .driver = { + .name = KBUILD_MODNAME, + }, +}; + +module_platform_driver(simatic_ipc_batt_driver); + +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:" KBUILD_MODNAME); +MODULE_SOFTDEP("pre: simatic-ipc-batt platform:elkhartlake-pinctrl"); +MODULE_AUTHOR("Henning Schild <henning.schild@siemens.com>"); |