linux/drivers/input/serio/olpc_apsp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * OLPC serio driver for multiplexed input from Marvell MMP security processor
 *
 * Copyright (C) 2011-2013 One Laptop Per Child
 */

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/serio.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/delay.h>

/*
 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
 * Instead, the OLPC firmware runs a bit-banging PS/2 implementation on an
 * otherwise-unused slow processor which is included in the Marvell MMP2/MMP3
 * SoC, known as the "Security Processor" (SP) or "Wireless Trusted Module"
 * (WTM). This firmware then reports its results via the WTM registers,
 * which we read from the Application Processor (AP, i.e. main CPU) in this
 * driver.
 *
 * On the hardware side we have a PS/2 mouse and an AT keyboard, the data
 * is multiplexed through this system. We create a serio port for each one,
 * and demultiplex the data accordingly.
 */

/* WTM register offsets */
#define SECURE_PROCESSOR_COMMAND
#define COMMAND_RETURN_STATUS
#define COMMAND_FIFO_STATUS
#define PJ_RST_INTERRUPT
#define PJ_INTERRUPT_MASK

/*
 * The upper byte of SECURE_PROCESSOR_COMMAND and COMMAND_RETURN_STATUS is
 * used to identify which port (device) is being talked to. The lower byte
 * is the data being sent/received.
 */
#define PORT_MASK
#define DATA_MASK
#define PORT_SHIFT
#define KEYBOARD_PORT
#define TOUCHPAD_PORT

/* COMMAND_FIFO_STATUS */
#define CMD_CNTR_MASK
#define MAX_PENDING_CMDS

/* PJ_RST_INTERRUPT */
#define SP_COMMAND_COMPLETE_RESET

/* PJ_INTERRUPT_MASK */
#define INT_0

/* COMMAND_FIFO_STATUS */
#define CMD_STS_MASK

struct olpc_apsp {};

static int olpc_apsp_write(struct serio *port, unsigned char val)
{}

static irqreturn_t olpc_apsp_rx(int irq, void *dev_id)
{}

static int olpc_apsp_open(struct serio *port)
{}

static void olpc_apsp_close(struct serio *port)
{}

static int olpc_apsp_probe(struct platform_device *pdev)
{}

static void olpc_apsp_remove(struct platform_device *pdev)
{}

static const struct of_device_id olpc_apsp_dt_ids[] =;
MODULE_DEVICE_TABLE(of, olpc_apsp_dt_ids);

static struct platform_driver olpc_apsp_driver =;

MODULE_DESCRIPTION();
MODULE_LICENSE();
module_platform_driver();