// SPDX-License-Identifier: GPL-2.0-only /* * Amstrad E3 (Delta) keyboard port driver * * Copyright (c) 2006 Matt Callow * Copyright (c) 2010 Janusz Krzysztofik * * Thanks to Cliff Lawson for his help * * The Amstrad Delta keyboard (aka mailboard) uses normal PC-AT style serial * transmission. The keyboard port is formed of two GPIO lines, for clock * and data. Due to strict timing requirements of the interface, * the serial data stream is read and processed by a FIQ handler. * The resulting words are fetched by this driver from a circular buffer. * * Standard AT keyboard driver (atkbd) is used for handling the keyboard data. * However, when used with the E3 mailboard that producecs non-standard * scancodes, a custom key table must be prepared and loaded from userspace.
*/ #include <linux/irq.h> #include <linux/platform_data/ams-delta-fiq.h> #include <linux/platform_device.h> #include <linux/regulator/consumer.h> #include <linux/serio.h> #include <linux/slab.h> #include <linux/module.h>
#define DRIVER_NAME "ams-delta-serio"
MODULE_AUTHOR("Matt Callow");
MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver");
MODULE_LICENSE("GPL");
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM;
priv->fiq_buffer = pdev->dev.platform_data; if (!priv->fiq_buffer) return -EINVAL;
priv->vcc = devm_regulator_get(&pdev->dev, "vcc"); if (IS_ERR(priv->vcc)) {
err = PTR_ERR(priv->vcc);
dev_err(&pdev->dev, "regulator request failed (%d)\n", err); /* * When running on a non-dt platform and requested regulator * is not available, devm_regulator_get() never returns * -EPROBE_DEFER as it is not able to justify if the regulator * may still appear later. On the other hand, the board can * still set full constriants flag at late_initcall in order * to instruct devm_regulator_get() to returnn a dummy one * if sufficient. Hence, if we get -ENODEV here, let's convert * it to -EPROBE_DEFER and wait for the board to decide or * let Deferred Probe infrastructure handle this error.
*/ if (err == -ENODEV)
err = -EPROBE_DEFER; return err;
}
irq = platform_get_irq(pdev, 0); if (irq < 0) return -ENXIO;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.