linux/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c

/*
 * Copyright © 2016-2017 Broadcom
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * Portions of this file (derived from panel-simple.c) are:
 *
 * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sub license,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

/*
 * Raspberry Pi 7" touchscreen panel driver.
 *
 * The 7" touchscreen consists of a DPI LCD panel, a Toshiba
 * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR
 * controlling power management, the LCD PWM, and initial register
 * setup of the Tohsiba.
 *
 * This driver controls the TC358762 and ATTINY88, presenting a DSI
 * device with a drm_panel.
 */

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/pm.h>

#include <drm/drm_crtc.h>
#include <drm/drm_device.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_panel.h>

#define RPI_DSI_DRIVER_NAME

/* I2C registers of the Atmel microcontroller. */
enum REG_ADDR {};

/* DSI D-PHY Layer Registers */
#define D0W_DPHYCONTTX
#define CLW_DPHYCONTRX
#define D0W_DPHYCONTRX
#define D1W_DPHYCONTRX
#define COM_DPHYCONTRX
#define CLW_CNTRL
#define D0W_CNTRL
#define D1W_CNTRL
#define DFTMODE_CNTRL

/* DSI PPI Layer Registers */
#define PPI_STARTPPI
#define PPI_BUSYPPI
#define PPI_LINEINITCNT
#define PPI_LPTXTIMECNT
#define PPI_CLS_ATMR
#define PPI_D0S_ATMR
#define PPI_D1S_ATMR
#define PPI_D0S_CLRSIPOCOUNT
#define PPI_D1S_CLRSIPOCOUNT
#define CLS_PRE
#define D0S_PRE
#define D1S_PRE
#define CLS_PREP
#define D0S_PREP
#define D1S_PREP
#define CLS_ZERO
#define D0S_ZERO
#define D1S_ZERO
#define PPI_CLRFLG
#define PPI_CLRSIPO
#define HSTIMEOUT
#define HSTIMEOUTENABLE

/* DSI Protocol Layer Registers */
#define DSI_STARTDSI
#define DSI_BUSYDSI
#define DSI_LANEENABLE
#define DSI_LANEENABLE_CLOCK
#define DSI_LANEENABLE_D0
#define DSI_LANEENABLE_D1

#define DSI_LANESTATUS0
#define DSI_LANESTATUS1
#define DSI_INTSTATUS
#define DSI_INTMASK
#define DSI_INTCLR
#define DSI_LPTXTO
#define DSI_MODE
#define DSI_PAYLOAD0
#define DSI_PAYLOAD1
#define DSI_SHORTPKTDAT
#define DSI_SHORTPKTREQ
#define DSI_BTASTA
#define DSI_BTACLR

/* DSI General Registers */
#define DSIERRCNT
#define DSISIGMOD

/* DSI Application Layer Registers */
#define APLCTRL
#define APLSTAT
#define APLERR
#define PWRMOD
#define RDPKTLN
#define PXLFMT
#define MEMWRCMD

/* LCDC/DPI Host Registers */
#define LCDCTRL
#define HSR
#define HDISPR
#define VSR
#define VDISPR
#define VFUEN

/* DBI-B Host Registers */
#define DBIBCTRL

/* SPI Master Registers */
#define SPICMR
#define SPITCR

/* System Controller Registers */
#define SYSSTAT
#define SYSCTRL
#define SYSPLL1
#define SYSPLL2
#define SYSPLL3
#define SYSPMCTRL

/* GPIO Registers */
#define GPIOC
#define GPIOO
#define GPIOI

/* I2C Registers */
#define I2CCLKCTRL

/* Chip/Rev Registers */
#define IDREG

/* Debug Registers */
#define WCMDQUEUE
#define RCMDQUEUE

struct rpi_touchscreen {};

static const struct drm_display_mode rpi_touchscreen_modes[] =;

static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel)
{}

static int rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg)
{}

static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts,
				      u8 reg, u8 val)
{}

static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val)
{}

static int rpi_touchscreen_disable(struct drm_panel *panel)
{}

static int rpi_touchscreen_noop(struct drm_panel *panel)
{}

static int rpi_touchscreen_prepare(struct drm_panel *panel)
{}

static int rpi_touchscreen_enable(struct drm_panel *panel)
{}

static int rpi_touchscreen_get_modes(struct drm_panel *panel,
				     struct drm_connector *connector)
{}

static const struct drm_panel_funcs rpi_touchscreen_funcs =;

static int rpi_touchscreen_probe(struct i2c_client *i2c)
{}

static void rpi_touchscreen_remove(struct i2c_client *i2c)
{}

static int rpi_touchscreen_dsi_probe(struct mipi_dsi_device *dsi)
{}

static struct mipi_dsi_driver rpi_touchscreen_dsi_driver =;

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

static struct i2c_driver rpi_touchscreen_driver =;

static int __init rpi_touchscreen_init(void)
{}
module_init();

static void __exit rpi_touchscreen_exit(void)
{}
module_exit(rpi_touchscreen_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();