23 #define DSS_SUBSYS_NAME "DISPLAY"
25 #include <linux/kernel.h>
26 #include <linux/module.h>
57 r = dssdev->
driver->enable(dssdev);
61 dssdev->
driver->disable(dssdev);
74 dssdev->
driver->get_te(dssdev) : 0);
84 if (!dssdev->
driver->enable_te || !dssdev->
driver->get_te)
91 r = dssdev->
driver->enable_te(dssdev, te);
104 if (!dssdev->
driver->get_timings)
107 dssdev->
driver->get_timings(dssdev, &
t);
111 t.x_res,
t.hfp,
t.hbp,
t.hsw,
112 t.y_res,
t.vfp,
t.vbp,
t.vsw);
122 if (!dssdev->
driver->set_timings || !dssdev->
driver->check_timings)
126 #ifdef CONFIG_OMAP2_DSS_VENC
127 if (
strncmp(
"pal", buf, 3) == 0) {
130 }
else if (
strncmp(
"ntsc", buf, 4) == 0) {
135 if (!found &&
sscanf(buf,
"%u,%hu/%hu/%hu/%hu,%hu/%hu/%hu/%hu",
141 r = dssdev->
driver->check_timings(dssdev, &t);
145 dssdev->
driver->disable(dssdev);
146 dssdev->
driver->set_timings(dssdev, &t);
147 r = dssdev->
driver->enable(dssdev);
159 if (!dssdev->
driver->get_rotate)
161 rotate = dssdev->
driver->get_rotate(dssdev);
171 if (!dssdev->
driver->set_rotate || !dssdev->
driver->get_rotate)
178 r = dssdev->
driver->set_rotate(dssdev, rot);
190 if (!dssdev->
driver->get_mirror)
192 mirror = dssdev->
driver->get_mirror(dssdev);
203 if (!dssdev->
driver->set_mirror || !dssdev->
driver->get_mirror)
210 r = dssdev->
driver->set_mirror(dssdev, mirror);
223 if (!dssdev->
driver->get_wss)
226 wss = dssdev->
driver->get_wss(dssdev);
238 if (!dssdev->
driver->get_wss || !dssdev->
driver->set_wss)
241 r = kstrtou32(buf, 0, &wss);
248 r = dssdev->
driver->set_wss(dssdev, wss);
256 display_enabled_show, display_enabled_store);
258 display_tear_show, display_tear_store);
260 display_timings_show, display_timings_store);
262 display_rotate_show, display_rotate_store);
264 display_mirror_show, display_mirror_store);
266 display_wss_show, display_wss_store);
281 *xres = dssdev->
panel.timings.x_res;
282 *yres = dssdev->
panel.timings.y_res;
288 switch (dssdev->
type) {
290 if (dssdev->
phy.
dpi.data_lines == 24)
296 if (dssdev->
ctrl.pixel_size == 24)
319 *timings = dssdev->
panel.timings;
341 DSSERR(
"failed to connect output to new device\n");
347 if (mgr->
output && !force)
355 DSSERR(
"failed to connect manager to output of new device\n");
371 DSSERR(
"failed to set initial overlay\n");
400 force = def_disp_name &&
strcmp(def_disp_name, dssdev->
name) == 0;
401 dss_init_connections(dssdev, force);
405 while ((attr = display_sysfs_attrs[i++]) !=
NULL) {
408 for (i = i - 2; i >= 0; i--) {
409 attr = display_sysfs_attrs[
i];
413 dss_uninit_connections(dssdev);
415 DSSERR(
"failed to create sysfs file\n");
422 dev_name(&dssdev->
dev));
424 while ((attr = display_sysfs_attrs[i++]) !=
NULL)
427 dss_uninit_connections(dssdev);
429 DSSERR(
"failed to create sysfs display link\n");
444 while ((attr = display_sysfs_attrs[i++]) !=
NULL)
447 dss_uninit_connections(dssdev);
450 static int dss_suspend_device(
struct device *dev,
void *
data)
460 if (!dssdev->
driver->suspend) {
461 DSSERR(
"display '%s' doesn't implement suspend\n",
466 r = dssdev->
driver->suspend(dssdev);
490 static int dss_resume_device(
struct device *dev,
void *data)
496 r = dssdev->
driver->resume(dssdev);
513 static int dss_disable_device(
struct device *dev,
void *data)
518 dssdev->
driver->disable(dssdev);
556 dev_start = &from->
dev;
573 if (
match(dssdev, data))
588 if (!try_module_get(dssdev->
dev.driver->owner)) {
598 module_put(dssdev->
dev.driver->owner);