Lines Matching refs:ws
104 static void ws2401_read_mtp_id(struct ws2401 *ws)
106 struct mipi_dbi *dbi = &ws->dbi;
112 dev_err(ws->dev, "unable to read MTP ID 1\n");
117 dev_err(ws->dev, "unable to read MTP ID 2\n");
122 dev_err(ws->dev, "unable to read MTP ID 3\n");
125 dev_info(ws->dev, "MTP ID: %02x %02x %02x\n", id1, id2, id3);
128 static int ws2401_power_on(struct ws2401 *ws)
130 struct mipi_dbi *dbi = &ws->dbi;
134 ret = regulator_bulk_enable(ARRAY_SIZE(ws->regulators),
135 ws->regulators);
137 dev_err(ws->dev, "failed to enable regulators: %d\n", ret);
143 gpiod_set_value_cansleep(ws->reset, 1);
146 gpiod_set_value_cansleep(ws->reset, 0);
149 dev_dbg(ws->dev, "de-asserted RESET\n");
208 if (ws->internal_bl) {
223 static int ws2401_power_off(struct ws2401 *ws)
226 gpiod_set_value_cansleep(ws->reset, 1);
227 return regulator_bulk_disable(ARRAY_SIZE(ws->regulators),
228 ws->regulators);
233 struct ws2401 *ws = to_ws2401(panel);
234 struct mipi_dbi *dbi = &ws->dbi;
237 if (ws->internal_bl)
246 struct ws2401 *ws = to_ws2401(panel);
247 struct mipi_dbi *dbi = &ws->dbi;
262 struct ws2401 *ws = to_ws2401(panel);
263 struct mipi_dbi *dbi = &ws->dbi;
278 struct ws2401 *ws = to_ws2401(panel);
290 dev_err(ws->dev, "failed to add mode\n");
320 struct ws2401 *ws = bl_get_data(bl);
321 struct mipi_dbi *dbi = &ws->dbi;
347 struct ws2401 *ws;
350 ws = devm_kzalloc(dev, sizeof(*ws), GFP_KERNEL);
351 if (!ws)
353 ws->dev = dev;
359 ws->regulators[0].supply = "vci";
360 ws->regulators[1].supply = "vccio";
362 ARRAY_SIZE(ws->regulators),
363 ws->regulators);
367 ws->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
368 if (IS_ERR(ws->reset)) {
369 ret = PTR_ERR(ws->reset);
373 ret = mipi_dbi_spi_init(spi, &ws->dbi, NULL);
376 ws->dbi.read_commands = ws2401_dbi_read_commands;
378 ws2401_power_on(ws);
379 ws2401_read_mtp_id(ws);
380 ws2401_power_off(ws);
382 drm_panel_init(&ws->panel, dev, &ws2401_drm_funcs,
385 ret = drm_panel_of_backlight(&ws->panel);
390 if (!ws->panel.backlight) {
392 ws->panel.backlight =
393 devm_backlight_device_register(dev, "ws2401", dev, ws,
395 if (IS_ERR(ws->panel.backlight))
396 return dev_err_probe(dev, PTR_ERR(ws->panel.backlight),
402 spi_set_drvdata(spi, ws);
404 drm_panel_add(&ws->panel);
412 struct ws2401 *ws = spi_get_drvdata(spi);
414 drm_panel_remove(&ws->panel);