23 #include <linux/module.h>
34 #define AMS_DELTA_DEFAULT_CONTRAST 112
36 #define AMS_DELTA_MAX_CONTRAST 0x00FF
37 #define AMS_DELTA_LCD_POWER 0x0100
42 static int ams_delta_lcd;
44 static int ams_delta_lcd_set_power(
struct lcd_device *
dev,
int power)
57 ams_delta_lcd &= ~AMS_DELTA_LCD_POWER;
68 ams_delta_lcd |=
value;
73 #ifdef CONFIG_LCD_CLASS_DEVICE
74 static int ams_delta_lcd_get_power(
struct lcd_device *dev)
82 static int ams_delta_lcd_get_contrast(
struct lcd_device *dev)
90 static struct lcd_ops ams_delta_lcd_ops = {
92 .set_power = ams_delta_lcd_set_power,
93 .get_contrast = ams_delta_lcd_get_contrast,
94 .set_contrast = ams_delta_lcd_set_contrast,
101 static const struct gpio _gpios[] = {
103 .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN,
105 .label =
"lcd_vblen",
108 .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP,
110 .label =
"lcd_ndisp",
114 static int ams_delta_panel_init(
struct lcd_panel *panel,
120 static void ams_delta_panel_cleanup(
struct lcd_panel *panel)
125 static int ams_delta_panel_enable(
struct lcd_panel *panel)
132 static void ams_delta_panel_disable(
struct lcd_panel *panel)
138 static unsigned long ams_delta_panel_get_caps(
struct lcd_panel *panel)
143 static struct lcd_panel ams_delta_panel = {
161 .init = ams_delta_panel_init,
162 .cleanup = ams_delta_panel_cleanup,
163 .enable = ams_delta_panel_enable,
164 .disable = ams_delta_panel_disable,
165 .get_caps = ams_delta_panel_get_caps,
174 #ifdef CONFIG_LCD_CLASS_DEVICE
180 if (IS_ERR(lcd_device)) {
181 ret = PTR_ERR(lcd_device);
182 dev_err(&pdev->
dev,
"failed to register device\n");
186 platform_set_drvdata(pdev, lcd_device);
214 .probe = ams_delta_panel_probe,
215 .remove = ams_delta_panel_remove,
216 .suspend = ams_delta_panel_suspend,
217 .resume = ams_delta_panel_resume,
219 .name =
"lcd_ams_delta",