#include <linux/backlight.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/slab.h>
#define REG_ID …
#define REG_PORTA …
#define REG_PORTB …
#define REG_PORTC …
#define REG_POWERON …
#define REG_PWM …
#define REG_ADDR_L …
#define REG_ADDR_H …
#define REG_WRITE_DATA_H …
#define REG_WRITE_DATA_L …
#define PA_LCD_DITHB …
#define PA_LCD_MODE …
#define PA_LCD_LR …
#define PA_LCD_UD …
#define PB_BRIDGE_PWRDNX_N …
#define PB_LCD_VCC_N …
#define PB_LCD_MAIN …
#define PC_LED_EN …
#define PC_RST_TP_N …
#define PC_RST_LCD_N …
#define PC_RST_BRIDGE_N …
enum gpio_signals { … };
struct gpio_signal_mappings { … };
static const struct gpio_signal_mappings mappings[NUM_GPIO] = …;
struct attiny_lcd { … };
static const struct regmap_config attiny_regmap_config = …;
static int attiny_set_port_state(struct attiny_lcd *state, int reg, u8 val)
{
state->port_states[reg - REG_PORTA] = val;
return regmap_write(state->regmap, reg, val);
};
static u8 attiny_get_port_state(struct attiny_lcd *state, int reg)
{
return state->port_states[reg - REG_PORTA];
};
static int attiny_lcd_power_enable(struct regulator_dev *rdev)
{ … }
static int attiny_lcd_power_disable(struct regulator_dev *rdev)
{ … }
static int attiny_lcd_power_is_enabled(struct regulator_dev *rdev)
{ … }
static const struct regulator_init_data attiny_regulator_default = …;
static const struct regulator_ops attiny_regulator_ops = …;
static const struct regulator_desc attiny_regulator = …;
static int attiny_update_status(struct backlight_device *bl)
{ … }
static const struct backlight_ops attiny_bl = …;
static int attiny_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
{ … }
static void attiny_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
{ … }
static int attiny_i2c_read(struct i2c_client *client, u8 reg, unsigned int *buf)
{ … }
static int attiny_i2c_probe(struct i2c_client *i2c)
{ … }
static void attiny_i2c_remove(struct i2c_client *client)
{ … }
static const struct of_device_id attiny_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, attiny_dt_ids);
static struct i2c_driver attiny_regulator_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;