Lines Matching refs:dev

95 	struct udevice *dev;  member
98 static int seps525_spi_write_cmd(struct udevice *dev, u32 reg) in seps525_spi_write_cmd() argument
100 struct seps525_priv *priv = dev_get_priv(dev); in seps525_spi_write_cmd()
106 dev_dbg(dev, "Failed to handle dc\n"); in seps525_spi_write_cmd()
110 ret = dm_spi_xfer(dev, 8, &buf8, NULL, SPI_XFER_BEGIN | SPI_XFER_END); in seps525_spi_write_cmd()
112 dev_dbg(dev, "Failed to write command\n"); in seps525_spi_write_cmd()
117 static int seps525_spi_write_data(struct udevice *dev, u32 val) in seps525_spi_write_data() argument
119 struct seps525_priv *priv = dev_get_priv(dev); in seps525_spi_write_data()
125 dev_dbg(dev, "Failed to handle dc\n"); in seps525_spi_write_data()
129 ret = dm_spi_xfer(dev, 8, &buf8, NULL, SPI_XFER_BEGIN | SPI_XFER_END); in seps525_spi_write_data()
131 dev_dbg(dev, "Failed to write data\n"); in seps525_spi_write_data()
136 static void seps525_spi_write(struct udevice *dev, u32 reg, u32 val) in seps525_spi_write() argument
138 (void)seps525_spi_write_cmd(dev, reg); in seps525_spi_write()
139 (void)seps525_spi_write_data(dev, val); in seps525_spi_write()
142 static int seps525_display_init(struct udevice *dev) in seps525_display_init() argument
145 seps525_spi_write(dev, SEPS525_REDUCE_CURRENT, 0x03); in seps525_display_init()
149 seps525_spi_write(dev, SEPS525_REDUCE_CURRENT, 0x00); in seps525_display_init()
152 seps525_spi_write(dev, SEPS525_SCREEN_SAVER_CONTEROL, 0x00); in seps525_display_init()
154 seps525_spi_write(dev, SEPS525_OSC_CTL, 0x01); in seps525_display_init()
156 seps525_spi_write(dev, SEPS525_CLOCK_DIV, 0x90); in seps525_display_init()
158 seps525_spi_write(dev, SEPS525_IREF, 0x01); in seps525_display_init()
161 seps525_spi_write(dev, SEPS525_PRECHARGE_TIME_R, 0x04); in seps525_display_init()
162 seps525_spi_write(dev, SEPS525_PRECHARGE_TIME_G, 0x05); in seps525_display_init()
163 seps525_spi_write(dev, SEPS525_PRECHARGE_TIME_B, 0x05); in seps525_display_init()
166 seps525_spi_write(dev, SEPS525_PRECHARGE_CURRENT_R, 0x9D); in seps525_display_init()
167 seps525_spi_write(dev, SEPS525_PRECHARGE_CURRENT_G, 0x8C); in seps525_display_init()
168 seps525_spi_write(dev, SEPS525_PRECHARGE_CURRENT_B, 0x57); in seps525_display_init()
171 seps525_spi_write(dev, SEPS525_DRIVING_CURRENT_R, 0x56); in seps525_display_init()
172 seps525_spi_write(dev, SEPS525_DRIVING_CURRENT_G, 0x4D); in seps525_display_init()
173 seps525_spi_write(dev, SEPS525_DRIVING_CURRENT_B, 0x46); in seps525_display_init()
175 seps525_spi_write(dev, SEPS525_DISPLAYMODE_SET, 0x00); in seps525_display_init()
177 seps525_spi_write(dev, SEPS525_RGBIF, 0x01); in seps525_display_init()
179 seps525_spi_write(dev, SEPS525_MEMORY_WRITEMODE, 0x66); in seps525_display_init()
181 seps525_spi_write(dev, SEPS525_DUTY, 0x7F); in seps525_display_init()
183 seps525_spi_write(dev, SEPS525_DSL, 0x00); in seps525_display_init()
185 seps525_spi_write(dev, SEPS525_DISP_ONOFF, 0x01); in seps525_display_init()
187 seps525_spi_write(dev, SEPS525_SOFT_RST, 0x00); in seps525_display_init()
189 seps525_spi_write(dev, SEPS525_RGB_POL, 0x00); in seps525_display_init()
192 (void)seps525_spi_write_cmd(dev, SEPS525_DDRAM_DATA_ACCESS_PORT); in seps525_display_init()
197 static int seps525_spi_startup(struct udevice *dev) in seps525_spi_startup() argument
199 struct seps525_priv *priv = dev_get_priv(dev); in seps525_spi_startup()
210 ret = dm_spi_claim_bus(dev); in seps525_spi_startup()
212 dev_err(dev, "Failed to claim SPI bus: %d\n", ret); in seps525_spi_startup()
216 ret = seps525_display_init(dev); in seps525_spi_startup()
220 dm_spi_release_bus(dev); in seps525_spi_startup()
229 struct udevice *dev = priv->dev; in seps525_sync() local
234 ret = dm_spi_claim_bus(dev); in seps525_sync()
236 dev_err(dev, "Failed to claim SPI bus: %d\n", ret); in seps525_sync()
241 seps525_spi_write(dev, SEPS525_MEMORY_ACCESS_POINTER_X, 0); in seps525_sync()
242 seps525_spi_write(dev, SEPS525_MEMORY_ACCESS_POINTER_Y, 0); in seps525_sync()
245 (void)seps525_spi_write_cmd(dev, SEPS525_DDRAM_DATA_ACCESS_PORT); in seps525_sync()
250 (void)seps525_spi_write_data(dev, data1); in seps525_sync()
251 (void)seps525_spi_write_data(dev, data2); in seps525_sync()
254 dm_spi_release_bus(dev); in seps525_sync()
259 static int seps525_probe(struct udevice *dev) in seps525_probe() argument
261 struct video_priv *uc_priv = dev_get_uclass_priv(dev); in seps525_probe()
262 struct seps525_priv *priv = dev_get_priv(dev); in seps525_probe()
266 buswidth = dev_read_u32_default(dev, "buswidth", 0); in seps525_probe()
268 dev_err(dev, "Only 8bit buswidth is supported now"); in seps525_probe()
272 ret = gpio_request_by_name(dev, "reset-gpios", 0, in seps525_probe()
275 dev_err(dev, "missing reset GPIO\n"); in seps525_probe()
279 ret = gpio_request_by_name(dev, "dc-gpios", 0, in seps525_probe()
282 dev_err(dev, "missing dc GPIO\n"); in seps525_probe()
291 priv->dev = dev; in seps525_probe()
293 ret = seps525_spi_startup(dev); in seps525_probe()
300 static int seps525_bind(struct udevice *dev) in seps525_bind() argument
302 struct video_uc_plat *plat = dev_get_uclass_plat(dev); in seps525_bind()