Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 1 | /* |
| 2 | * i.MX drm driver - parallel display implementation |
| 3 | * |
| 4 | * Copyright (C) 2012 Sascha Hauer, Pengutronix |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 16 | #include <linux/component.h> |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 17 | #include <linux/module.h> |
| 18 | #include <drm/drmP.h> |
Liu Ying | 255c35f | 2016-07-08 17:40:56 +0800 | [diff] [blame^] | 19 | #include <drm/drm_atomic_helper.h> |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 20 | #include <drm/drm_fb_helper.h> |
| 21 | #include <drm/drm_crtc_helper.h> |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 22 | #include <drm/drm_panel.h> |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 23 | #include <linux/videodev2.h> |
Lothar Waßmann | 075c457 | 2014-01-13 11:24:33 +0100 | [diff] [blame] | 24 | #include <video/of_display_timing.h> |
Philipp Zabel | 553a59f | 2015-05-19 16:28:12 +0200 | [diff] [blame] | 25 | #include <linux/of_graph.h> |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 26 | |
| 27 | #include "imx-drm.h" |
| 28 | |
| 29 | #define con_to_imxpd(x) container_of(x, struct imx_parallel_display, connector) |
| 30 | #define enc_to_imxpd(x) container_of(x, struct imx_parallel_display, encoder) |
| 31 | |
| 32 | struct imx_parallel_display { |
| 33 | struct drm_connector connector; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 34 | struct drm_encoder encoder; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 35 | struct device *dev; |
| 36 | void *edid; |
| 37 | int edid_len; |
Philipp Zabel | 2872c80 | 2015-02-02 17:25:59 +0100 | [diff] [blame] | 38 | u32 bus_format; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 39 | struct drm_display_mode mode; |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 40 | struct drm_panel *panel; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | static enum drm_connector_status imx_pd_connector_detect( |
| 44 | struct drm_connector *connector, bool force) |
| 45 | { |
| 46 | return connector_status_connected; |
| 47 | } |
| 48 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 49 | static int imx_pd_connector_get_modes(struct drm_connector *connector) |
| 50 | { |
| 51 | struct imx_parallel_display *imxpd = con_to_imxpd(connector); |
Marek Vasut | afb12ed | 2013-04-03 12:36:28 -0300 | [diff] [blame] | 52 | struct device_node *np = imxpd->dev->of_node; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 53 | int num_modes = 0; |
| 54 | |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 55 | if (imxpd->panel && imxpd->panel->funcs && |
| 56 | imxpd->panel->funcs->get_modes) { |
Philipp Zabel | 9832e81 | 2015-11-13 18:10:04 +0100 | [diff] [blame] | 57 | struct drm_display_info *di = &connector->display_info; |
| 58 | |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 59 | num_modes = imxpd->panel->funcs->get_modes(imxpd->panel); |
Philipp Zabel | 9832e81 | 2015-11-13 18:10:04 +0100 | [diff] [blame] | 60 | if (!imxpd->bus_format && di->num_bus_formats) |
| 61 | imxpd->bus_format = di->bus_formats[0]; |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 62 | if (num_modes > 0) |
| 63 | return num_modes; |
| 64 | } |
| 65 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 66 | if (imxpd->edid) { |
| 67 | drm_mode_connector_update_edid_property(connector, imxpd->edid); |
| 68 | num_modes = drm_add_edid_modes(connector, imxpd->edid); |
| 69 | } |
| 70 | |
Marek Vasut | afb12ed | 2013-04-03 12:36:28 -0300 | [diff] [blame] | 71 | if (np) { |
| 72 | struct drm_display_mode *mode = drm_mode_create(connector->dev); |
Quentin Lambert | 63bc5164 | 2014-08-04 21:07:07 +0200 | [diff] [blame] | 73 | |
Fabio Estevam | 39dcf4f | 2014-02-26 20:53:42 -0300 | [diff] [blame] | 74 | if (!mode) |
| 75 | return -EINVAL; |
Lothar Waßmann | 075c457 | 2014-01-13 11:24:33 +0100 | [diff] [blame] | 76 | of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE); |
Marek Vasut | afb12ed | 2013-04-03 12:36:28 -0300 | [diff] [blame] | 77 | drm_mode_copy(mode, &imxpd->mode); |
| 78 | mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, |
| 79 | drm_mode_probed_add(connector, mode); |
| 80 | num_modes++; |
| 81 | } |
| 82 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 83 | return num_modes; |
| 84 | } |
| 85 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 86 | static struct drm_encoder *imx_pd_connector_best_encoder( |
| 87 | struct drm_connector *connector) |
| 88 | { |
| 89 | struct imx_parallel_display *imxpd = con_to_imxpd(connector); |
| 90 | |
| 91 | return &imxpd->encoder; |
| 92 | } |
| 93 | |
| 94 | static void imx_pd_encoder_dpms(struct drm_encoder *encoder, int mode) |
| 95 | { |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 96 | struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); |
| 97 | |
| 98 | if (mode != DRM_MODE_DPMS_ON) |
| 99 | drm_panel_disable(imxpd->panel); |
| 100 | else |
| 101 | drm_panel_enable(imxpd->panel); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 102 | } |
| 103 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 104 | static void imx_pd_encoder_prepare(struct drm_encoder *encoder) |
| 105 | { |
| 106 | struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); |
Philipp Zabel | 4ed094f | 2016-05-09 17:02:13 +0200 | [diff] [blame] | 107 | imx_drm_set_bus_config(encoder, imxpd->bus_format, 2, 3, |
| 108 | imxpd->connector.display_info.bus_flags); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | static void imx_pd_encoder_commit(struct drm_encoder *encoder) |
| 112 | { |
Philipp Zabel | ad92c8b | 2014-11-03 15:54:47 +0100 | [diff] [blame] | 113 | struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); |
| 114 | |
| 115 | drm_panel_prepare(imxpd->panel); |
| 116 | drm_panel_enable(imxpd->panel); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | static void imx_pd_encoder_mode_set(struct drm_encoder *encoder, |
Steve Longerbeam | eb10d63 | 2014-12-18 18:00:24 -0800 | [diff] [blame] | 120 | struct drm_display_mode *orig_mode, |
| 121 | struct drm_display_mode *mode) |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 122 | { |
| 123 | } |
| 124 | |
| 125 | static void imx_pd_encoder_disable(struct drm_encoder *encoder) |
| 126 | { |
Philipp Zabel | ad92c8b | 2014-11-03 15:54:47 +0100 | [diff] [blame] | 127 | struct imx_parallel_display *imxpd = enc_to_imxpd(encoder); |
| 128 | |
| 129 | drm_panel_disable(imxpd->panel); |
| 130 | drm_panel_unprepare(imxpd->panel); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 131 | } |
| 132 | |
Ville Syrjälä | 7ae847d | 2015-12-15 12:21:09 +0100 | [diff] [blame] | 133 | static const struct drm_connector_funcs imx_pd_connector_funcs = { |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 134 | .dpms = drm_helper_connector_dpms, |
| 135 | .fill_modes = drm_helper_probe_single_connector_modes, |
| 136 | .detect = imx_pd_connector_detect, |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 137 | .destroy = imx_drm_connector_destroy, |
Liu Ying | 255c35f | 2016-07-08 17:40:56 +0800 | [diff] [blame^] | 138 | .reset = drm_atomic_helper_connector_reset, |
| 139 | .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, |
| 140 | .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 141 | }; |
| 142 | |
Ville Syrjälä | 7ae847d | 2015-12-15 12:21:09 +0100 | [diff] [blame] | 143 | static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = { |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 144 | .get_modes = imx_pd_connector_get_modes, |
| 145 | .best_encoder = imx_pd_connector_best_encoder, |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 146 | }; |
| 147 | |
Ville Syrjälä | 7ae847d | 2015-12-15 12:21:09 +0100 | [diff] [blame] | 148 | static const struct drm_encoder_funcs imx_pd_encoder_funcs = { |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 149 | .destroy = imx_drm_encoder_destroy, |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 150 | }; |
| 151 | |
Ville Syrjälä | 7ae847d | 2015-12-15 12:21:09 +0100 | [diff] [blame] | 152 | static const struct drm_encoder_helper_funcs imx_pd_encoder_helper_funcs = { |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 153 | .dpms = imx_pd_encoder_dpms, |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 154 | .prepare = imx_pd_encoder_prepare, |
| 155 | .commit = imx_pd_encoder_commit, |
| 156 | .mode_set = imx_pd_encoder_mode_set, |
| 157 | .disable = imx_pd_encoder_disable, |
| 158 | }; |
| 159 | |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 160 | static int imx_pd_register(struct drm_device *drm, |
| 161 | struct imx_parallel_display *imxpd) |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 162 | { |
| 163 | int ret; |
| 164 | |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 165 | ret = imx_drm_encoder_parse_of(drm, &imxpd->encoder, |
| 166 | imxpd->dev->of_node); |
| 167 | if (ret) |
| 168 | return ret; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 169 | |
Denis Carikli | c026a3f | 2014-06-17 15:34:51 +0200 | [diff] [blame] | 170 | /* set the connector's dpms to OFF so that |
| 171 | * drm_helper_connector_dpms() won't return |
| 172 | * immediately since the current state is ON |
| 173 | * at this point. |
| 174 | */ |
| 175 | imxpd->connector.dpms = DRM_MODE_DPMS_OFF; |
| 176 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 177 | drm_encoder_helper_add(&imxpd->encoder, &imx_pd_encoder_helper_funcs); |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 178 | drm_encoder_init(drm, &imxpd->encoder, &imx_pd_encoder_funcs, |
Ville Syrjälä | 13a3d91 | 2015-12-09 16:20:18 +0200 | [diff] [blame] | 179 | DRM_MODE_ENCODER_NONE, NULL); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 180 | |
| 181 | drm_connector_helper_add(&imxpd->connector, |
| 182 | &imx_pd_connector_helper_funcs); |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 183 | drm_connector_init(drm, &imxpd->connector, &imx_pd_connector_funcs, |
| 184 | DRM_MODE_CONNECTOR_VGA); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 185 | |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 186 | if (imxpd->panel) |
| 187 | drm_panel_attach(imxpd->panel, &imxpd->connector); |
| 188 | |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 189 | drm_mode_connector_attach_encoder(&imxpd->connector, &imxpd->encoder); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 190 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 191 | return 0; |
| 192 | } |
| 193 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 194 | static int imx_pd_bind(struct device *dev, struct device *master, void *data) |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 195 | { |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 196 | struct drm_device *drm = data; |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 197 | struct device_node *np = dev->of_node; |
Philipp Zabel | 3a1c117 | 2016-05-03 14:39:29 +0200 | [diff] [blame] | 198 | struct device_node *ep; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 199 | const u8 *edidp; |
| 200 | struct imx_parallel_display *imxpd; |
| 201 | int ret; |
| 202 | const char *fmt; |
| 203 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 204 | imxpd = devm_kzalloc(dev, sizeof(*imxpd), GFP_KERNEL); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 205 | if (!imxpd) |
| 206 | return -ENOMEM; |
| 207 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 208 | edidp = of_get_property(np, "edid", &imxpd->edid_len); |
| 209 | if (edidp) |
| 210 | imxpd->edid = kmemdup(edidp, imxpd->edid_len, GFP_KERNEL); |
| 211 | |
| 212 | ret = of_property_read_string(np, "interface-pix-fmt", &fmt); |
| 213 | if (!ret) { |
| 214 | if (!strcmp(fmt, "rgb24")) |
Philipp Zabel | 2872c80 | 2015-02-02 17:25:59 +0100 | [diff] [blame] | 215 | imxpd->bus_format = MEDIA_BUS_FMT_RGB888_1X24; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 216 | else if (!strcmp(fmt, "rgb565")) |
Philipp Zabel | 2872c80 | 2015-02-02 17:25:59 +0100 | [diff] [blame] | 217 | imxpd->bus_format = MEDIA_BUS_FMT_RGB565_1X16; |
Marek Vasut | 7d0a66c | 2013-04-22 23:19:31 +0200 | [diff] [blame] | 218 | else if (!strcmp(fmt, "bgr666")) |
Philipp Zabel | 2872c80 | 2015-02-02 17:25:59 +0100 | [diff] [blame] | 219 | imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X18; |
Emil Renner Berthing | 9e74d29 | 2014-03-29 13:57:44 +0100 | [diff] [blame] | 220 | else if (!strcmp(fmt, "lvds666")) |
Philipp Zabel | 2872c80 | 2015-02-02 17:25:59 +0100 | [diff] [blame] | 221 | imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 222 | } |
| 223 | |
Philipp Zabel | 553a59f | 2015-05-19 16:28:12 +0200 | [diff] [blame] | 224 | /* port@1 is the output port */ |
Philipp Zabel | 3a1c117 | 2016-05-03 14:39:29 +0200 | [diff] [blame] | 225 | ep = of_graph_get_endpoint_by_regs(np, 1, -1); |
| 226 | if (ep) { |
| 227 | struct device_node *remote; |
Philipp Zabel | 553a59f | 2015-05-19 16:28:12 +0200 | [diff] [blame] | 228 | |
Philipp Zabel | 3a1c117 | 2016-05-03 14:39:29 +0200 | [diff] [blame] | 229 | remote = of_graph_get_remote_port_parent(ep); |
| 230 | of_node_put(ep); |
| 231 | if (remote) { |
| 232 | imxpd->panel = of_drm_find_panel(remote); |
| 233 | of_node_put(remote); |
Philipp Zabel | 553a59f | 2015-05-19 16:28:12 +0200 | [diff] [blame] | 234 | } |
Philipp Zabel | 3a1c117 | 2016-05-03 14:39:29 +0200 | [diff] [blame] | 235 | if (!imxpd->panel) |
| 236 | return -EPROBE_DEFER; |
Liu Ying | d70e96a | 2015-02-23 11:09:51 +0800 | [diff] [blame] | 237 | } |
Philipp Zabel | 628f435b | 2014-02-25 11:55:04 +0100 | [diff] [blame] | 238 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 239 | imxpd->dev = dev; |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 240 | |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 241 | ret = imx_pd_register(drm, imxpd); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 242 | if (ret) |
| 243 | return ret; |
| 244 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 245 | dev_set_drvdata(dev, imxpd); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 246 | |
| 247 | return 0; |
| 248 | } |
| 249 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 250 | static void imx_pd_unbind(struct device *dev, struct device *master, |
| 251 | void *data) |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 252 | { |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 253 | struct imx_parallel_display *imxpd = dev_get_drvdata(dev); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 254 | |
Russell King | 1b3f767 | 2013-11-03 13:30:48 +0000 | [diff] [blame] | 255 | imxpd->encoder.funcs->destroy(&imxpd->encoder); |
| 256 | imxpd->connector.funcs->destroy(&imxpd->connector); |
Peter Seiderer | dcbc9eb | 2013-12-08 22:03:58 +0100 | [diff] [blame] | 257 | |
| 258 | kfree(imxpd->edid); |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 259 | } |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 260 | |
Russell King | 17b5001 | 2013-11-03 11:23:34 +0000 | [diff] [blame] | 261 | static const struct component_ops imx_pd_ops = { |
| 262 | .bind = imx_pd_bind, |
| 263 | .unbind = imx_pd_unbind, |
| 264 | }; |
| 265 | |
| 266 | static int imx_pd_probe(struct platform_device *pdev) |
| 267 | { |
| 268 | return component_add(&pdev->dev, &imx_pd_ops); |
| 269 | } |
| 270 | |
| 271 | static int imx_pd_remove(struct platform_device *pdev) |
| 272 | { |
| 273 | component_del(&pdev->dev, &imx_pd_ops); |
Peter Seiderer | dcbc9eb | 2013-12-08 22:03:58 +0100 | [diff] [blame] | 274 | |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 275 | return 0; |
| 276 | } |
| 277 | |
| 278 | static const struct of_device_id imx_pd_dt_ids[] = { |
| 279 | { .compatible = "fsl,imx-parallel-display", }, |
| 280 | { /* sentinel */ } |
| 281 | }; |
Jiada Wang | fa45f2c | 2013-06-07 18:36:46 +0900 | [diff] [blame] | 282 | MODULE_DEVICE_TABLE(of, imx_pd_dt_ids); |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 283 | |
| 284 | static struct platform_driver imx_pd_driver = { |
| 285 | .probe = imx_pd_probe, |
Bill Pemberton | 99c28f1 | 2012-11-19 13:20:51 -0500 | [diff] [blame] | 286 | .remove = imx_pd_remove, |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 287 | .driver = { |
| 288 | .of_match_table = imx_pd_dt_ids, |
| 289 | .name = "imx-parallel-display", |
Sascha Hauer | 19022aa | 2012-09-21 10:07:48 +0200 | [diff] [blame] | 290 | }, |
| 291 | }; |
| 292 | |
| 293 | module_platform_driver(imx_pd_driver); |
| 294 | |
| 295 | MODULE_DESCRIPTION("i.MX parallel display driver"); |
| 296 | MODULE_AUTHOR("Sascha Hauer, Pengutronix"); |
| 297 | MODULE_LICENSE("GPL"); |
Fabio Estevam | b2da05f | 2013-08-18 21:40:05 -0300 | [diff] [blame] | 298 | MODULE_ALIAS("platform:imx-parallel-display"); |