Date: | 2012-01-13 00:23:45 (12 years 2 months ago) |
---|---|
Author: | Paul Cercueil |
Commit: | a7bcc4e547fdaad12711ddb99f2f27ae72e2b510 |
Message: | MIPS: JZ4740: SLCD: added a parameter to select the panel. |
Files: |
drivers/video/jz4740_slcd.h (1 diff) drivers/video/jz4740_slcd_panels.c (3 diffs) |
Change Details
drivers/video/jz4740_slcd.h | ||
---|---|---|
107 | 107 | void (*enable)(struct jzfb *jzfb); |
108 | 108 | /* deactivate */ |
109 | 109 | void (*disable)(struct jzfb *jzfb); |
110 | /* panel name */ | |
111 | const char *name; | |
110 | 112 | }; |
111 | 113 | |
112 | 114 | const struct jz_slcd_panel *jz_slcd_panels_probe(struct jzfb *jzfb); |
drivers/video/jz4740_slcd_panels.c | ||
---|---|---|
23 | 23 | |
24 | 24 | #include "jz4740_slcd.h" |
25 | 25 | |
26 | static unsigned int jz_slcd_panel = 0; | |
27 | ||
26 | 28 | /* Send a command without data. */ |
27 | 29 | static void send_panel_command(struct jzfb *jzfb, u32 cmd) { |
28 | 30 | u16 slcd_cfg = readw(jzfb->base + JZ_REG_SLCD_CFG); |
... | ... | |
820 | 822 | { |
821 | 823 | ili9325_init, ili9325_exit, |
822 | 824 | ili9325_enable, ili9325_disable, |
825 | "ili9325", | |
823 | 826 | }, |
824 | 827 | #endif |
825 | 828 | #ifdef CONFIG_JZ_SLCD_ILI9331 |
826 | 829 | { |
827 | 830 | ili9331_init, ili9331_exit, |
828 | 831 | ili9331_enable, ili9331_disable, |
832 | "ili9331", | |
829 | 833 | }, |
830 | 834 | #endif |
831 | 835 | #ifdef CONFIG_JZ_SLCD_ILI9338 |
832 | 836 | { |
833 | 837 | ili9338_init, ili9338_exit, |
834 | 838 | ili9338_enable, ili9338_disable, |
839 | "ili9338", | |
835 | 840 | }, |
836 | 841 | #endif |
837 | 842 | #ifdef CONFIG_JZ_SLCD_LGDP4551 |
838 | 843 | { |
839 | 844 | lgdp4551_init, lgdp4551_exit, |
840 | 845 | lgdp4551_enable, lgdp4551_disable, |
846 | "lgdp4551", | |
841 | 847 | }, |
842 | 848 | #endif |
843 | 849 | #ifdef CONFIG_JZ_SLCD_SPFD5420A |
844 | 850 | { |
845 | 851 | spfd5420a_init, spfd5420a_exit, |
846 | 852 | spfd5420a_enable, spfd5420a_disable, |
853 | "spfd5420a", | |
847 | 854 | }, |
848 | 855 | #endif |
849 | 856 | }; |
850 | 857 | |
858 | static int __init jz_slcd_panels_setup(char *this_opt) | |
859 | { | |
860 | char *options; | |
861 | ||
862 | while ((options = strsep(&this_opt, ",")) != NULL) { | |
863 | if (!strncmp(options, "panel:", 6)) { | |
864 | unsigned int i; | |
865 | ||
866 | options += 6; | |
867 | for (i = 0; i < ARRAY_SIZE(jz_slcd_panels); i++) { | |
868 | if (!strcmp(options, jz_slcd_panels[i].name)) { | |
869 | jz_slcd_panel = i; | |
870 | break; | |
871 | } | |
872 | } | |
873 | ||
874 | continue; | |
875 | } | |
876 | } | |
877 | ||
878 | return 0; | |
879 | } | |
880 | ||
881 | __setup("jz_slcd=", jz_slcd_panels_setup); | |
882 | ||
851 | 883 | const struct jz_slcd_panel *jz_slcd_panels_probe(struct jzfb *jzfb) |
852 | 884 | { |
853 | 885 | switch (ARRAY_SIZE(jz_slcd_panels)) { |
... | ... | |
856 | 888 | case 1: |
857 | 889 | return &jz_slcd_panels[0]; |
858 | 890 | default: |
859 | dev_warn(&jzfb->pdev->dev, | |
860 | "SLCD panel selection not implemented yet; " | |
861 | "picking first panel\n"); | |
862 | return &jz_slcd_panels[0]; | |
891 | return &jz_slcd_panels[jz_slcd_panel]; | |
863 | 892 | } |
864 | 893 | } |
Branches:
ben-wpan
ben-wpan-stefan
5396a9238205f20f811ea57898980d3ca82df0b6
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9