Skip to content

Commit

Permalink
drm/panel: ili9322: move bus_flags to get_modes()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
sravnborg committed Aug 10, 2019
1 parent ce7d93a commit 9d027b8
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions drivers/gpu/drm/panel/panel-ilitek-ili9322.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

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;

connector->display_info.width_mm = ili->conf->width_mm;
connector->display_info.height_mm = ili->conf->height_mm;
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:
Expand Down

0 comments on commit 9d027b8

Please sign in to comment.