#include <linux/fb.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/lcd.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/string.h>
#define REG_START_OSCILLATION …
#define REG_DRIVER_CODE_READ …
#define REG_DRIVER_OUTPUT_CONTROL …
#define REG_LCD_AC_DRIVEING_CONTROL …
#define REG_ENTRY_MODE …
#define REG_COMPARE_1 …
#define REG_COMPARE_2 …
#define REG_DISPLAY_CONTROL_1 …
#define REG_DISPLAY_CONTROL_2 …
#define REG_DISPLAY_CONTROL_3 …
#define REG_FRAME_CYCLE_CONTROL …
#define REG_EXT_INTF_CONTROL …
#define REG_POWER_CONTROL_1 …
#define REG_POWER_CONTROL_2 …
#define REG_POWER_CONTROL_3 …
#define REG_POWER_CONTROL_4 …
#define REG_RAM_ADDRESS_SET …
#define REG_WRITE_DATA_TO_GRAM …
#define REG_RAM_WRITE_MASK1 …
#define REG_RAM_WRITE_MASK2 …
#define REG_GAMMA_CONTROL_1 …
#define REG_GAMMA_CONTROL_2 …
#define REG_GAMMA_CONTROL_3 …
#define REG_GAMMA_CONTROL_4 …
#define REG_GAMMA_CONTROL_5 …
#define REG_GAMMA_CONTROL_6 …
#define REG_GAMMA_CONTROL_7 …
#define REG_GAMMA_CONTROL_8 …
#define REG_GAMMA_CONTROL_9 …
#define REG_GAMMA_CONTROL_10 …
#define REG_GATE_SCAN_CONTROL …
#define REG_VERT_SCROLL_CONTROL …
#define REG_FIRST_SCREEN_DRIVE_POS …
#define REG_SECOND_SCREEN_DRIVE_POS …
#define REG_RAM_ADDR_POS_H …
#define REG_RAM_ADDR_POS_V …
#define REG_OSCILLATOR_CONTROL …
#define REG_GPIO …
#define REG_OTP_VCM_PROGRAMMING …
#define REG_OTP_VCM_STATUS_ENABLE …
#define REG_OTP_PROGRAMMING_ID_KEY …
#define ILITEK_MAX_FREQ_REG …
#define ILITEK_DEVICE_ID …
#define ILITEK_DEVICE_ID_MASK …
#define START_RS_INDEX …
#define START_RS_REG …
#define START_RW_WRITE …
#define START_RW_READ …
#define START_BYTE(id, rs, rw) …
#define CHECK_FREQ_REG(s, x) …
#define CMD_BUFSIZE …
#define POWER_IS_ON(pwr) …
#define set_tx_byte(b) …
static int ili922x_id = …;
module_param(ili922x_id, int, 0);
static int tx_invert;
module_param(tx_invert, int, 0);
struct ili922x { … };
static int ili922x_read_status(struct spi_device *spi, u16 *rs)
{ … }
static int ili922x_read(struct spi_device *spi, u8 reg, u16 *rx)
{ … }
static int ili922x_write(struct spi_device *spi, u8 reg, u16 value)
{ … }
#ifdef DEBUG
static void ili922x_reg_dump(struct spi_device *spi)
{
u8 reg;
u16 rx;
dev_dbg(&spi->dev, "ILI922x configuration registers:\n");
for (reg = REG_START_OSCILLATION;
reg <= REG_OTP_PROGRAMMING_ID_KEY; reg++) {
ili922x_read(spi, reg, &rx);
dev_dbg(&spi->dev, "reg @ 0x%02X: 0x%04X\n", reg, rx);
}
}
#else
static inline void ili922x_reg_dump(struct spi_device *spi) { … }
#endif
static void set_write_to_gram_reg(struct spi_device *spi)
{ … }
static int ili922x_poweron(struct spi_device *spi)
{ … }
static int ili922x_poweroff(struct spi_device *spi)
{ … }
static void ili922x_display_init(struct spi_device *spi)
{ … }
static int ili922x_lcd_power(struct ili922x *lcd, int power)
{ … }
static int ili922x_set_power(struct lcd_device *ld, int power)
{ … }
static int ili922x_get_power(struct lcd_device *ld)
{ … }
static const struct lcd_ops ili922x_ops = …;
static int ili922x_probe(struct spi_device *spi)
{ … }
static void ili922x_remove(struct spi_device *spi)
{ … }
static struct spi_driver ili922x_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;