Lines Matching refs:sharp

38 static void sharp_wait_frames(struct sharp_panel *sharp, unsigned int frames)  in sharp_wait_frames()  argument
40 unsigned int refresh = drm_mode_vrefresh(sharp->mode); in sharp_wait_frames()
48 static int sharp_panel_write(struct sharp_panel *sharp, u16 offset, u8 value) in sharp_panel_write() argument
51 struct mipi_dsi_device *dsi = sharp->link1; in sharp_panel_write()
72 static __maybe_unused int sharp_panel_read(struct sharp_panel *sharp, in sharp_panel_read() argument
79 err = mipi_dsi_generic_read(sharp->link1, &offset, sizeof(offset), in sharp_panel_read()
82 dev_err(&sharp->link1->dev, "failed to read from %04x: %zd\n", in sharp_panel_read()
90 struct sharp_panel *sharp = to_sharp_panel(panel); in sharp_panel_disable() local
92 if (!sharp->enabled) in sharp_panel_disable()
95 sharp->enabled = false; in sharp_panel_disable()
102 struct sharp_panel *sharp = to_sharp_panel(panel); in sharp_panel_unprepare() local
105 if (!sharp->prepared) in sharp_panel_unprepare()
108 sharp_wait_frames(sharp, 4); in sharp_panel_unprepare()
110 err = mipi_dsi_dcs_set_display_off(sharp->link1); in sharp_panel_unprepare()
114 err = mipi_dsi_dcs_enter_sleep_mode(sharp->link1); in sharp_panel_unprepare()
120 regulator_disable(sharp->supply); in sharp_panel_unprepare()
122 sharp->prepared = false; in sharp_panel_unprepare()
163 struct sharp_panel *sharp = to_sharp_panel(panel); in sharp_panel_prepare() local
167 if (sharp->prepared) in sharp_panel_prepare()
170 err = regulator_enable(sharp->supply); in sharp_panel_prepare()
182 err = mipi_dsi_dcs_exit_sleep_mode(sharp->link1); in sharp_panel_prepare()
198 err = sharp_panel_write(sharp, 0x1000, 0x2a); in sharp_panel_prepare()
205 err = sharp_panel_write(sharp, 0x1001, 0x01); in sharp_panel_prepare()
211 err = mipi_dsi_dcs_set_pixel_format(sharp->link1, format); in sharp_panel_prepare()
224 err = sharp_setup_symmetrical_split(sharp->link1, sharp->link2, in sharp_panel_prepare()
225 sharp->mode); in sharp_panel_prepare()
232 err = mipi_dsi_dcs_set_display_on(sharp->link1); in sharp_panel_prepare()
238 sharp->prepared = true; in sharp_panel_prepare()
241 sharp_wait_frames(sharp, 6); in sharp_panel_prepare()
246 regulator_disable(sharp->supply); in sharp_panel_prepare()
252 struct sharp_panel *sharp = to_sharp_panel(panel); in sharp_panel_enable() local
254 if (sharp->enabled) in sharp_panel_enable()
257 sharp->enabled = true; in sharp_panel_enable()
311 static int sharp_panel_add(struct sharp_panel *sharp) in sharp_panel_add() argument
315 sharp->mode = &default_mode; in sharp_panel_add()
317 sharp->supply = devm_regulator_get(&sharp->link1->dev, "power"); in sharp_panel_add()
318 if (IS_ERR(sharp->supply)) in sharp_panel_add()
319 return PTR_ERR(sharp->supply); in sharp_panel_add()
321 drm_panel_init(&sharp->base, &sharp->link1->dev, &sharp_panel_funcs, in sharp_panel_add()
324 ret = drm_panel_of_backlight(&sharp->base); in sharp_panel_add()
328 drm_panel_add(&sharp->base); in sharp_panel_add()
333 static void sharp_panel_del(struct sharp_panel *sharp) in sharp_panel_del() argument
335 if (sharp->base.dev) in sharp_panel_del()
336 drm_panel_remove(&sharp->base); in sharp_panel_del()
338 if (sharp->link2) in sharp_panel_del()
339 put_device(&sharp->link2->dev); in sharp_panel_del()
345 struct sharp_panel *sharp; in sharp_panel_probe() local
365 sharp = devm_kzalloc(&dsi->dev, sizeof(*sharp), GFP_KERNEL); in sharp_panel_probe()
366 if (!sharp) { in sharp_panel_probe()
371 mipi_dsi_set_drvdata(dsi, sharp); in sharp_panel_probe()
373 sharp->link2 = secondary; in sharp_panel_probe()
374 sharp->link1 = dsi; in sharp_panel_probe()
376 err = sharp_panel_add(sharp); in sharp_panel_probe()
386 sharp_panel_del(sharp); in sharp_panel_probe()
396 struct sharp_panel *sharp = mipi_dsi_get_drvdata(dsi); in sharp_panel_remove() local
400 if (!sharp) { in sharp_panel_remove()
405 err = drm_panel_disable(&sharp->base); in sharp_panel_remove()
413 sharp_panel_del(sharp); in sharp_panel_remove()
418 struct sharp_panel *sharp = mipi_dsi_get_drvdata(dsi); in sharp_panel_shutdown() local
421 if (!sharp) in sharp_panel_shutdown()
424 drm_panel_disable(&sharp->base); in sharp_panel_shutdown()