/* * Generic DSI Command Mode panel driver * * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * * 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. *//* #define DEBUG */#include<linux/backlight.h>#include<linux/delay.h>#include<linux/gpio/consumer.h>#include<linux/interrupt.h>#include<linux/jiffies.h>#include<linux/module.h>#include<linux/platform_device.h>#include<linux/sched/signal.h>#include<linux/slab.h>#include<linux/workqueue.h>#include<linux/of_device.h>#include<linux/regulator/consumer.h>#include<video/mipi_display.h>#include<video/of_display_timing.h>#include"../dss/omapdss.h"/* DSI Virtual channel. Hardcoded for now. */#define TCH 0#define DCS_READ_NUM_ERRORS 0x05#define DCS_BRIGHTNESS 0x51#define DCS_CTRL_DISPLAY 0x53#define DCS_GET_ID1 0xda#define DCS_GET_ID2 0xdb#define DCS_GET_ID3 0xdcstructpanel_drv_data{structomap_dss_devicedssdev;structvideomodevm;structplatform_device*pdev;structmutexlock;structbacklight_device*bldev;structbacklight_device*extbldev;unsignedlonghw_guard_end;/* next value of jiffies when we can * issue the next sleep in/out command */unsignedlonghw_guard_wait;/* max guard time in jiffies *//* panel HW configuration from DT or platform data */structgpio_desc*reset_gpio;structgpio_desc*ext_te_gpio;structregulator*vpnl;structregulator*vddi;booluse_dsi_backlight;intwidth_mm;intheight_mm;structomap_dsi_pin_configpin_config;/* runtime variables */boolenabled;boolte_enabled;atomic_tdo_update;intchannel;structdelayed_workte_timeout_work;boolintro_printed;