drm/panel: ili9322: move bus_flags to get_modes()
To prepare the driver to receive drm_connector only in the get_modes() callback, move bus_flags handling to ili9322_get_modes(). Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190804201637.1240-11-sam@ravnborg.org
This commit is contained in:
parent
ce7d93aa2a
commit
9d027b8e5a
|
@ -349,7 +349,6 @@ static const struct regmap_config ili9322_regmap_config = {
|
|||
|
||||
static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
|
||||
{
|
||||
struct drm_connector *connector = panel->connector;
|
||||
u8 reg;
|
||||
int ret;
|
||||
int i;
|
||||
|
@ -407,23 +406,11 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
|
|||
* Polarity and inverted color order for RGB input.
|
||||
* None of this applies in the BT.656 mode.
|
||||
*/
|
||||
if (ili->conf->dclk_active_high) {
|
||||
reg = 0;
|
||||
if (ili->conf->dclk_active_high)
|
||||
reg = ILI9322_POL_DCLK;
|
||||
connector->display_info.bus_flags |=
|
||||
DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE;
|
||||
} else {
|
||||
reg = 0;
|
||||
connector->display_info.bus_flags |=
|
||||
DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE;
|
||||
}
|
||||
if (ili->conf->de_active_high) {
|
||||
if (ili->conf->de_active_high)
|
||||
reg |= ILI9322_POL_DE;
|
||||
connector->display_info.bus_flags |=
|
||||
DRM_BUS_FLAG_DE_HIGH;
|
||||
} else {
|
||||
connector->display_info.bus_flags |=
|
||||
DRM_BUS_FLAG_DE_LOW;
|
||||
}
|
||||
if (ili->conf->hsync_active_high)
|
||||
reg |= ILI9322_POL_HSYNC;
|
||||
if (ili->conf->vsync_active_high)
|
||||
|
@ -659,9 +646,20 @@ static int ili9322_get_modes(struct drm_panel *panel)
|
|||
struct drm_connector *connector = panel->connector;
|
||||
struct ili9322 *ili = panel_to_ili9322(panel);
|
||||
struct drm_display_mode *mode;
|
||||
struct drm_display_info *info;
|
||||
|
||||
connector->display_info.width_mm = ili->conf->width_mm;
|
||||
connector->display_info.height_mm = ili->conf->height_mm;
|
||||
info = &connector->display_info;
|
||||
info->width_mm = ili->conf->width_mm;
|
||||
info->height_mm = ili->conf->height_mm;
|
||||
if (ili->conf->dclk_active_high)
|
||||
info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE;
|
||||
else
|
||||
info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE;
|
||||
|
||||
if (ili->conf->de_active_high)
|
||||
info->bus_flags |= DRM_BUS_FLAG_DE_HIGH;
|
||||
else
|
||||
info->bus_flags |= DRM_BUS_FLAG_DE_LOW;
|
||||
|
||||
switch (ili->input) {
|
||||
case ILI9322_INPUT_SRGB_DUMMY_320X240:
|
||||
|
|
Loading…
Reference in New Issue