diff options
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_drv.c')
| -rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_drv.c | 46 | 
1 files changed, 25 insertions, 21 deletions
| diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 4f5fc3e87383..f1d3a9f919fd 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -105,7 +105,7 @@ static void modeset_init(struct drm_device *dev)  	dev->mode_config.min_width = 0;  	dev->mode_config.min_height = 0; -	dev->mode_config.max_width = tilcdc_crtc_max_width(priv->crtc); +	dev->mode_config.max_width = priv->max_width;  	dev->mode_config.max_height = 2048;  	dev->mode_config.funcs = &mode_config_funcs;  } @@ -166,7 +166,7 @@ static void tilcdc_fini(struct drm_device *dev)  	drm_dev_put(dev);  } -static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) +static int tilcdc_init(const struct drm_driver *ddrv, struct device *dev)  {  	struct drm_device *ddev;  	struct platform_device *pdev = to_platform_device(dev); @@ -218,22 +218,6 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)  		goto init_failed;  	} -	if (of_property_read_u32(node, "max-bandwidth", &priv->max_bandwidth)) -		priv->max_bandwidth = TILCDC_DEFAULT_MAX_BANDWIDTH; - -	DBG("Maximum Bandwidth Value %d", priv->max_bandwidth); - -	if (of_property_read_u32(node, "max-width", &priv->max_width)) -		priv->max_width = TILCDC_DEFAULT_MAX_WIDTH; - -	DBG("Maximum Horizontal Pixel Width Value %dpixels", priv->max_width); - -	if (of_property_read_u32(node, "max-pixelclock", -					&priv->max_pixelclock)) -		priv->max_pixelclock = TILCDC_DEFAULT_MAX_PIXELCLOCK; - -	DBG("Maximum Pixel Clock Value %dKHz", priv->max_pixelclock); -  	pm_runtime_enable(dev);  	/* Determine LCD IP Version */ @@ -287,6 +271,26 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)  		}  	} +	if (of_property_read_u32(node, "max-bandwidth", &priv->max_bandwidth)) +		priv->max_bandwidth = TILCDC_DEFAULT_MAX_BANDWIDTH; + +	DBG("Maximum Bandwidth Value %d", priv->max_bandwidth); + +	if (of_property_read_u32(node, "max-width", &priv->max_width)) { +		if (priv->rev == 1) +			priv->max_width = TILCDC_DEFAULT_MAX_WIDTH_V1; +		else +			priv->max_width = TILCDC_DEFAULT_MAX_WIDTH_V2; +	} + +	DBG("Maximum Horizontal Pixel Width Value %dpixels", priv->max_width); + +	if (of_property_read_u32(node, "max-pixelclock", +				 &priv->max_pixelclock)) +		priv->max_pixelclock = TILCDC_DEFAULT_MAX_PIXELCLOCK; + +	DBG("Maximum Pixel Clock Value %dKHz", priv->max_pixelclock); +  	ret = tilcdc_crtc_create(ddev);  	if (ret < 0) {  		dev_err(dev, "failed to create crtc\n"); @@ -428,8 +432,8 @@ static int tilcdc_mm_show(struct seq_file *m, void *arg)  }  static struct drm_info_list tilcdc_debugfs_list[] = { -		{ "regs", tilcdc_regs_show, 0 }, -		{ "mm",   tilcdc_mm_show,   0 }, +		{ "regs", tilcdc_regs_show, 0, NULL }, +		{ "mm",   tilcdc_mm_show,   0, NULL },  };  static void tilcdc_debugfs_init(struct drm_minor *minor) @@ -448,7 +452,7 @@ static void tilcdc_debugfs_init(struct drm_minor *minor)  DEFINE_DRM_GEM_CMA_FOPS(fops); -static struct drm_driver tilcdc_driver = { +static const struct drm_driver tilcdc_driver = {  	.driver_features    = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,  	.irq_handler        = tilcdc_irq,  	DRM_GEM_CMA_DRIVER_OPS, | 
