Lines Matching refs:spi
24 struct spi_device *spi; member
46 static void l4f00242t03_lcd_init(struct spi_device *spi) in l4f00242t03_lcd_init() argument
48 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_lcd_init()
52 dev_dbg(&spi->dev, "initializing LCD\n"); in l4f00242t03_lcd_init()
56 dev_err(&spi->dev, "failed to set the IO regulator voltage.\n"); in l4f00242t03_lcd_init()
61 dev_err(&spi->dev, "failed to enable the IO regulator.\n"); in l4f00242t03_lcd_init()
67 dev_err(&spi->dev, "failed to set the core regulator voltage.\n"); in l4f00242t03_lcd_init()
73 dev_err(&spi->dev, "failed to enable the core regulator.\n"); in l4f00242t03_lcd_init()
82 spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16)); in l4f00242t03_lcd_init()
85 static void l4f00242t03_lcd_powerdown(struct spi_device *spi) in l4f00242t03_lcd_powerdown() argument
87 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_lcd_powerdown()
89 dev_dbg(&spi->dev, "Powering down LCD\n"); in l4f00242t03_lcd_powerdown()
107 struct spi_device *spi = priv->spi; in l4f00242t03_lcd_power_set() local
119 dev_dbg(&spi->dev, "Resuming LCD\n"); in l4f00242t03_lcd_power_set()
121 spi_write(spi, (const u8 *)&slpout, sizeof(u16)); in l4f00242t03_lcd_power_set()
123 spi_write(spi, (const u8 *)&dison, sizeof(u16)); in l4f00242t03_lcd_power_set()
126 l4f00242t03_lcd_init(spi); in l4f00242t03_lcd_power_set()
133 dev_dbg(&spi->dev, "Standby the LCD\n"); in l4f00242t03_lcd_power_set()
135 spi_write(spi, (const u8 *)&disoff, sizeof(u16)); in l4f00242t03_lcd_power_set()
137 spi_write(spi, (const u8 *)&slpin, sizeof(u16)); in l4f00242t03_lcd_power_set()
142 l4f00242t03_lcd_init(spi); in l4f00242t03_lcd_power_set()
150 spi_write(spi, (const u8 *)&disoff, sizeof(u16)); in l4f00242t03_lcd_power_set()
152 l4f00242t03_lcd_powerdown(spi); in l4f00242t03_lcd_power_set()
166 static int l4f00242t03_probe(struct spi_device *spi) in l4f00242t03_probe() argument
171 priv = devm_kzalloc(&spi->dev, sizeof(struct l4f00242t03_priv), in l4f00242t03_probe()
176 spi_set_drvdata(spi, priv); in l4f00242t03_probe()
177 spi->bits_per_word = 9; in l4f00242t03_probe()
178 ret = spi_setup(spi); in l4f00242t03_probe()
180 return dev_err_probe(&spi->dev, ret, "Unable to setup spi.\n"); in l4f00242t03_probe()
182 priv->spi = spi; in l4f00242t03_probe()
184 priv->reset = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_HIGH); in l4f00242t03_probe()
186 return dev_err_probe(&spi->dev, PTR_ERR(priv->reset), in l4f00242t03_probe()
190 priv->enable = devm_gpiod_get(&spi->dev, "enable", GPIOD_OUT_LOW); in l4f00242t03_probe()
192 return dev_err_probe(&spi->dev, PTR_ERR(priv->enable), in l4f00242t03_probe()
196 priv->io_reg = devm_regulator_get(&spi->dev, "vdd"); in l4f00242t03_probe()
198 return dev_err_probe(&spi->dev, PTR_ERR(priv->io_reg), in l4f00242t03_probe()
202 priv->core_reg = devm_regulator_get(&spi->dev, "vcore"); in l4f00242t03_probe()
204 return dev_err_probe(&spi->dev, PTR_ERR(priv->core_reg), in l4f00242t03_probe()
208 priv->ld = devm_lcd_device_register(&spi->dev, "l4f00242t03", &spi->dev, in l4f00242t03_probe()
214 l4f00242t03_lcd_init(spi); in l4f00242t03_probe()
218 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); in l4f00242t03_probe()
223 static void l4f00242t03_remove(struct spi_device *spi) in l4f00242t03_remove() argument
225 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_remove()
230 static void l4f00242t03_shutdown(struct spi_device *spi) in l4f00242t03_shutdown() argument
232 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_shutdown()