Lines Matching full:spi

21 #include <linux/spi/spi.h>
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
170 priv = devm_kzalloc(&spi->dev, sizeof(struct l4f00242t03_priv), in l4f00242t03_probe()
175 spi_set_drvdata(spi, priv); in l4f00242t03_probe()
176 spi->bits_per_word = 9; in l4f00242t03_probe()
177 spi_setup(spi); in l4f00242t03_probe()
179 priv->spi = spi; in l4f00242t03_probe()
181 priv->reset = devm_gpiod_get(&spi->dev, "reset", GPIOD_OUT_HIGH); in l4f00242t03_probe()
183 dev_err(&spi->dev, in l4f00242t03_probe()
189 priv->enable = devm_gpiod_get(&spi->dev, "enable", GPIOD_OUT_LOW); in l4f00242t03_probe()
191 dev_err(&spi->dev, in l4f00242t03_probe()
197 priv->io_reg = devm_regulator_get(&spi->dev, "vdd"); in l4f00242t03_probe()
199 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", in l4f00242t03_probe()
204 priv->core_reg = devm_regulator_get(&spi->dev, "vcore"); in l4f00242t03_probe()
206 dev_err(&spi->dev, "%s: Unable to get the core regulator\n", in l4f00242t03_probe()
211 priv->ld = devm_lcd_device_register(&spi->dev, "l4f00242t03", &spi->dev, in l4f00242t03_probe()
217 l4f00242t03_lcd_init(spi); in l4f00242t03_probe()
221 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); in l4f00242t03_probe()
226 static int l4f00242t03_remove(struct spi_device *spi) in l4f00242t03_remove() argument
228 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_remove()
234 static void l4f00242t03_shutdown(struct spi_device *spi) in l4f00242t03_shutdown() argument
236 struct l4f00242t03_priv *priv = spi_get_drvdata(spi); in l4f00242t03_shutdown()