root/drivers/gpu/drm/arc/arcpgu_hdmi.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. arcpgu_drm_hdmi_init

   1 // SPDX-License-Identifier: GPL-2.0-only
   2 /*
   3  * ARC PGU DRM driver.
   4  *
   5  * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
   6  */
   7 
   8 #include <drm/drm_crtc.h>
   9 #include <drm/drm_encoder.h>
  10 #include <drm/drm_device.h>
  11 
  12 #include "arcpgu.h"
  13 
  14 static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
  15         .destroy = drm_encoder_cleanup,
  16 };
  17 
  18 int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
  19 {
  20         struct drm_encoder *encoder;
  21         struct drm_bridge *bridge;
  22 
  23         int ret = 0;
  24 
  25         encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
  26         if (encoder == NULL)
  27                 return -ENOMEM;
  28 
  29         /* Locate drm bridge from the hdmi encoder DT node */
  30         bridge = of_drm_find_bridge(np);
  31         if (!bridge)
  32                 return -EPROBE_DEFER;
  33 
  34         encoder->possible_crtcs = 1;
  35         encoder->possible_clones = 0;
  36         ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs,
  37                                DRM_MODE_ENCODER_TMDS, NULL);
  38         if (ret)
  39                 return ret;
  40 
  41         /* Link drm_bridge to encoder */
  42         ret = drm_bridge_attach(encoder, bridge, NULL);
  43         if (ret)
  44                 drm_encoder_cleanup(encoder);
  45 
  46         return ret;
  47 }

/* [<][>][^][v][top][bottom][index][help] */