aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/512x
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-07-09 16:38:14 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-07-13 04:01:39 -0400
commit7653aaab775d4c205a7dce52850c8e3d4f31d4ea (patch)
tree882f66ade2dc625c5f836a83f83a433fe679fbc3 /arch/powerpc/platforms/512x
parentc6daf05b6d7afca4c9e04a7361e284ef9e1d8dad (diff)
drivers/video: use strings to specify the Freescale DIU monitor port
Instead of using ill-defined numbers (0, 1, and 2) for the monitor port, allow the user to specify the port by name ("dvi", "lvds", or "dlvds"). This works on the kernel command line, the module command-line, and the sysfs "monitor" device. Note that changing the monitor port does not currently work on the P1022DS, because the code that talks to the PIXIS FPGA is broken. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/powerpc/platforms/512x')
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index e41ebbdb3e12..3dc62f907a1e 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -66,8 +66,8 @@ struct fsl_diu_shared_fb {
66 bool in_use; 66 bool in_use;
67}; 67};
68 68
69unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel, 69u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port,
70 int monitor_port) 70 unsigned int bits_per_pixel)
71{ 71{
72 switch (bits_per_pixel) { 72 switch (bits_per_pixel) {
73 case 32: 73 case 32:
@@ -80,11 +80,12 @@ unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel,
80 return 0x00000400; 80 return 0x00000400;
81} 81}
82 82
83void mpc512x_set_gamma_table(int monitor_port, char *gamma_table_base) 83void mpc512x_set_gamma_table(enum fsl_diu_monitor_port port,
84 char *gamma_table_base)
84{ 85{
85} 86}
86 87
87void mpc512x_set_monitor_port(int monitor_port) 88void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port)
88{ 89{
89} 90}
90 91
@@ -182,14 +183,10 @@ void mpc512x_set_pixel_clock(unsigned int pixclock)
182 iounmap(ccm); 183 iounmap(ccm);
183} 184}
184 185
185ssize_t mpc512x_show_monitor_port(int monitor_port, char *buf) 186enum fsl_diu_monitor_port
187mpc512x_valid_monitor_port(enum fsl_diu_monitor_port port)
186{ 188{
187 return sprintf(buf, "0 - 5121 LCD\n"); 189 return FSL_DIU_PORT_DVI;
188}
189
190int mpc512x_set_sysfs_monitor_port(int val)
191{
192 return 0;
193} 190}
194 191
195static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb; 192static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb;
@@ -332,8 +329,7 @@ void __init mpc512x_setup_diu(void)
332 diu_ops.set_gamma_table = mpc512x_set_gamma_table; 329 diu_ops.set_gamma_table = mpc512x_set_gamma_table;
333 diu_ops.set_monitor_port = mpc512x_set_monitor_port; 330 diu_ops.set_monitor_port = mpc512x_set_monitor_port;
334 diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; 331 diu_ops.set_pixel_clock = mpc512x_set_pixel_clock;
335 diu_ops.show_monitor_port = mpc512x_show_monitor_port; 332 diu_ops.valid_monitor_port = mpc512x_valid_monitor_port;
336 diu_ops.set_sysfs_monitor_port = mpc512x_set_sysfs_monitor_port;
337 diu_ops.release_bootmem = mpc512x_release_bootmem; 333 diu_ops.release_bootmem = mpc512x_release_bootmem;
338#endif 334#endif
339} 335}