diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-16 07:48:51 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-03 08:19:00 -0400 |
commit | e087cc21c6d23d27951d45289a096b825326d3e2 (patch) | |
tree | 27ebf1a2139596231335d0353b69e4986790ccf0 /drivers/video | |
parent | 5761217abf1636b6a0979548286e15200f17c010 (diff) |
OMAPDSS: Taal: remove multi-panel support
Taal panel driver was originally meant to support multiple different DSI
command mode panel models. This never realized, and the multi-panel
support code is lying there unused, making the driver more difficult to
maintain.
This patch removes the multi-panel support from Taal driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 109 |
1 files changed, 15 insertions, 94 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index a32407a5735a..038a815ba6c8 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -54,61 +54,6 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable); | |||
54 | 54 | ||
55 | static int taal_panel_reset(struct omap_dss_device *dssdev); | 55 | static int taal_panel_reset(struct omap_dss_device *dssdev); |
56 | 56 | ||
57 | /** | ||
58 | * struct panel_config - panel configuration | ||
59 | * @name: panel name | ||
60 | * @type: panel type | ||
61 | * @timings: panel resolution | ||
62 | * @sleep: various panel specific delays, passed to msleep() if non-zero | ||
63 | * @reset_sequence: reset sequence timings, passed to udelay() if non-zero | ||
64 | * @regulators: array of panel regulators | ||
65 | * @num_regulators: number of regulators in the array | ||
66 | */ | ||
67 | struct panel_config { | ||
68 | const char *name; | ||
69 | int type; | ||
70 | |||
71 | struct omap_video_timings timings; | ||
72 | |||
73 | struct { | ||
74 | unsigned int sleep_in; | ||
75 | unsigned int sleep_out; | ||
76 | unsigned int hw_reset; | ||
77 | unsigned int enable_te; | ||
78 | } sleep; | ||
79 | |||
80 | struct { | ||
81 | unsigned int high; | ||
82 | unsigned int low; | ||
83 | } reset_sequence; | ||
84 | |||
85 | }; | ||
86 | |||
87 | enum { | ||
88 | PANEL_TAAL, | ||
89 | }; | ||
90 | |||
91 | static struct panel_config panel_configs[] = { | ||
92 | { | ||
93 | .name = "taal", | ||
94 | .type = PANEL_TAAL, | ||
95 | .timings = { | ||
96 | .x_res = 864, | ||
97 | .y_res = 480, | ||
98 | }, | ||
99 | .sleep = { | ||
100 | .sleep_in = 5, | ||
101 | .sleep_out = 5, | ||
102 | .hw_reset = 5, | ||
103 | .enable_te = 100, /* possible panel bug */ | ||
104 | }, | ||
105 | .reset_sequence = { | ||
106 | .high = 10, | ||
107 | .low = 10, | ||
108 | }, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | struct taal_data { | 57 | struct taal_data { |
113 | struct mutex lock; | 58 | struct mutex lock; |
114 | 59 | ||
@@ -121,9 +66,6 @@ struct taal_data { | |||
121 | 66 | ||
122 | struct omap_dss_device *dssdev; | 67 | struct omap_dss_device *dssdev; |
123 | 68 | ||
124 | /* panel specific HW info */ | ||
125 | struct panel_config *panel_config; | ||
126 | |||
127 | /* panel HW configuration from DT or platform data */ | 69 | /* panel HW configuration from DT or platform data */ |
128 | int reset_gpio; | 70 | int reset_gpio; |
129 | int ext_te_gpio; | 71 | int ext_te_gpio; |
@@ -221,8 +163,7 @@ static int taal_sleep_in(struct taal_data *td) | |||
221 | 163 | ||
222 | hw_guard_start(td, 120); | 164 | hw_guard_start(td, 120); |
223 | 165 | ||
224 | if (td->panel_config->sleep.sleep_in) | 166 | msleep(5); |
225 | msleep(td->panel_config->sleep.sleep_in); | ||
226 | 167 | ||
227 | return 0; | 168 | return 0; |
228 | } | 169 | } |
@@ -239,8 +180,7 @@ static int taal_sleep_out(struct taal_data *td) | |||
239 | 180 | ||
240 | hw_guard_start(td, 120); | 181 | hw_guard_start(td, 120); |
241 | 182 | ||
242 | if (td->panel_config->sleep.sleep_out) | 183 | msleep(5); |
243 | msleep(td->panel_config->sleep.sleep_out); | ||
244 | 184 | ||
245 | return 0; | 185 | return 0; |
246 | } | 186 | } |
@@ -845,17 +785,14 @@ static void taal_hw_reset(struct omap_dss_device *dssdev) | |||
845 | return; | 785 | return; |
846 | 786 | ||
847 | gpio_set_value(td->reset_gpio, 1); | 787 | gpio_set_value(td->reset_gpio, 1); |
848 | if (td->panel_config->reset_sequence.high) | 788 | udelay(10); |
849 | udelay(td->panel_config->reset_sequence.high); | ||
850 | /* reset the panel */ | 789 | /* reset the panel */ |
851 | gpio_set_value(td->reset_gpio, 0); | 790 | gpio_set_value(td->reset_gpio, 0); |
852 | /* assert reset */ | 791 | /* assert reset */ |
853 | if (td->panel_config->reset_sequence.low) | 792 | udelay(10); |
854 | udelay(td->panel_config->reset_sequence.low); | ||
855 | gpio_set_value(td->reset_gpio, 1); | 793 | gpio_set_value(td->reset_gpio, 1); |
856 | /* wait after releasing reset */ | 794 | /* wait after releasing reset */ |
857 | if (td->panel_config->sleep.hw_reset) | 795 | msleep(5); |
858 | msleep(td->panel_config->sleep.hw_reset); | ||
859 | } | 796 | } |
860 | 797 | ||
861 | static void taal_probe_pdata(struct taal_data *td, | 798 | static void taal_probe_pdata(struct taal_data *td, |
@@ -881,8 +818,7 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
881 | struct backlight_properties props; | 818 | struct backlight_properties props; |
882 | struct taal_data *td; | 819 | struct taal_data *td; |
883 | struct backlight_device *bldev = NULL; | 820 | struct backlight_device *bldev = NULL; |
884 | int r, i; | 821 | int r; |
885 | const char *panel_name; | ||
886 | 822 | ||
887 | dev_dbg(&dssdev->dev, "probe\n"); | 823 | dev_dbg(&dssdev->dev, "probe\n"); |
888 | 824 | ||
@@ -897,26 +833,12 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
897 | const struct nokia_dsi_panel_data *pdata = dssdev->data; | 833 | const struct nokia_dsi_panel_data *pdata = dssdev->data; |
898 | 834 | ||
899 | taal_probe_pdata(td, pdata); | 835 | taal_probe_pdata(td, pdata); |
900 | |||
901 | panel_name = pdata->name; | ||
902 | } else { | 836 | } else { |
903 | return -ENODEV; | 837 | return -ENODEV; |
904 | } | 838 | } |
905 | 839 | ||
906 | if (panel_name == NULL) | 840 | dssdev->panel.timings.x_res = 864; |
907 | return -EINVAL; | 841 | dssdev->panel.timings.y_res = 480; |
908 | |||
909 | for (i = 0; i < ARRAY_SIZE(panel_configs); i++) { | ||
910 | if (strcmp(panel_name, panel_configs[i].name) == 0) { | ||
911 | td->panel_config = &panel_configs[i]; | ||
912 | break; | ||
913 | } | ||
914 | } | ||
915 | |||
916 | if (!td->panel_config) | ||
917 | return -EINVAL; | ||
918 | |||
919 | dssdev->panel.timings = td->panel_config->timings; | ||
920 | dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888; | 842 | dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888; |
921 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | | 843 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | |
922 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; | 844 | OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; |
@@ -1086,8 +1008,7 @@ static int taal_power_on(struct omap_dss_device *dssdev) | |||
1086 | goto err; | 1008 | goto err; |
1087 | 1009 | ||
1088 | /* on early Taal revisions CABC is broken */ | 1010 | /* on early Taal revisions CABC is broken */ |
1089 | if (td->panel_config->type == PANEL_TAAL && | 1011 | if (id2 == 0x00 || id2 == 0xff || id2 == 0x81) |
1090 | (id2 == 0x00 || id2 == 0xff || id2 == 0x81)) | ||
1091 | td->cabc_broken = true; | 1012 | td->cabc_broken = true; |
1092 | 1013 | ||
1093 | r = taal_dcs_write_1(td, DCS_BRIGHTNESS, 0xff); | 1014 | r = taal_dcs_write_1(td, DCS_BRIGHTNESS, 0xff); |
@@ -1129,8 +1050,8 @@ static int taal_power_on(struct omap_dss_device *dssdev) | |||
1129 | td->enabled = 1; | 1050 | td->enabled = 1; |
1130 | 1051 | ||
1131 | if (!td->intro_printed) { | 1052 | if (!td->intro_printed) { |
1132 | dev_info(&dssdev->dev, "%s panel revision %02x.%02x.%02x\n", | 1053 | dev_info(&dssdev->dev, "panel revision %02x.%02x.%02x\n", |
1133 | td->panel_config->name, id1, id2, id3); | 1054 | id1, id2, id3); |
1134 | if (td->cabc_broken) | 1055 | if (td->cabc_broken) |
1135 | dev_info(&dssdev->dev, | 1056 | dev_info(&dssdev->dev, |
1136 | "old Taal version, CABC disabled\n"); | 1057 | "old Taal version, CABC disabled\n"); |
@@ -1311,8 +1232,8 @@ static int taal_update(struct omap_dss_device *dssdev, | |||
1311 | 1232 | ||
1312 | /* XXX no need to send this every frame, but dsi break if not done */ | 1233 | /* XXX no need to send this every frame, but dsi break if not done */ |
1313 | r = taal_set_update_window(td, 0, 0, | 1234 | r = taal_set_update_window(td, 0, 0, |
1314 | td->panel_config->timings.x_res, | 1235 | dssdev->panel.timings.x_res, |
1315 | td->panel_config->timings.y_res); | 1236 | dssdev->panel.timings.y_res); |
1316 | if (r) | 1237 | if (r) |
1317 | goto err; | 1238 | goto err; |
1318 | 1239 | ||
@@ -1365,8 +1286,8 @@ static int _taal_enable_te(struct omap_dss_device *dssdev, bool enable) | |||
1365 | if (!gpio_is_valid(td->ext_te_gpio)) | 1286 | if (!gpio_is_valid(td->ext_te_gpio)) |
1366 | omapdss_dsi_enable_te(dssdev, enable); | 1287 | omapdss_dsi_enable_te(dssdev, enable); |
1367 | 1288 | ||
1368 | if (td->panel_config->sleep.enable_te) | 1289 | /* possible panel bug */ |
1369 | msleep(td->panel_config->sleep.enable_te); | 1290 | msleep(100); |
1370 | 1291 | ||
1371 | return r; | 1292 | return r; |
1372 | } | 1293 | } |