14 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16 #include <linux/device.h>
17 #include <linux/kernel.h>
19 #include <linux/module.h>
22 #include <linux/slab.h>
37 static void l4f00242t03_reset(
unsigned int gpio)
48 #define param(x) ((x) | 0x100)
84 static int l4f00242t03_lcd_power_get(
struct lcd_device *
ld)
91 static int l4f00242t03_lcd_power_set(
struct lcd_device *
ld,
int power)
96 const u16 slpout = 0x11;
97 const u16 dison = 0x29;
99 const u16 slpin = 0x10;
100 const u16 disoff = 0x28;
108 spi_write(spi, (
const u8 *)&slpout,
sizeof(
u16));
110 spi_write(spi, (
const u8 *)&dison,
sizeof(
u16));
113 l4f00242t03_lcd_init(spi);
115 l4f00242t03_lcd_power_set(priv->
ld, power);
122 spi_write(spi, (
const u8 *)&disoff,
sizeof(
u16));
124 spi_write(spi, (
const u8 *)&slpin,
sizeof(
u16));
129 l4f00242t03_lcd_init(spi);
131 l4f00242t03_lcd_power_set(ld, power);
137 spi_write(spi, (
const u8 *)&disoff,
sizeof(
u16));
139 l4f00242t03_lcd_powerdown(spi);
148 static struct lcd_ops l4f_ops = {
149 .set_power = l4f00242t03_lcd_power_set,
150 .get_power = l4f00242t03_lcd_power_get,
160 dev_err(&spi->
dev,
"Uninitialized platform data.\n");
168 dev_err(&spi->
dev,
"No memory for this device.\n");
182 "Unable to get the lcd l4f00242t03 reset gpio.\n");
190 "Unable to get the lcd l4f00242t03 data en gpio.\n");
195 if (IS_ERR(priv->
io_reg)) {
196 dev_err(&spi->
dev,
"%s: Unable to get the IO regulator\n",
198 return PTR_ERR(priv->
io_reg);
204 dev_err(&spi->
dev,
"%s: Unable to get the core regulator\n",
210 &spi->
dev, priv, &l4f_ops);
211 if (IS_ERR(priv->
ld)) {
212 ret = PTR_ERR(priv->
ld);
217 l4f00242t03_lcd_init(spi);
221 dev_info(&spi->
dev,
"Epson l4f00242t03 lcd probed.\n");
248 static void l4f00242t03_shutdown(
struct spi_device *spi)
257 static struct spi_driver l4f00242t03_driver = {
259 .name =
"l4f00242t03",
262 .probe = l4f00242t03_probe,
264 .shutdown = l4f00242t03_shutdown,