From 026abc333205c1fff80138b8c2cac3d0347685f4 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Thu, 8 Mar 2012 16:02:20 +0000 Subject: gma500: initial medfield merge We need to merge this ahead of some of the cleanup because a lot of needed cleanup spans both new and old chips. If we try and clean up and the merge we end up fighting ourselves. Signed-off-by: Kirill A. Shutemov [With a load of the cleanup stuff folded in, register stuff reworked sanely] Signed-off-by: Alan Cox Signed-off-by: Dave Airlie --- drivers/gpu/drm/gma500/mdfld_output.c | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 drivers/gpu/drm/gma500/mdfld_output.c (limited to 'drivers/gpu/drm/gma500/mdfld_output.c') diff --git a/drivers/gpu/drm/gma500/mdfld_output.c b/drivers/gpu/drm/gma500/mdfld_output.c new file mode 100644 index 000000000000..de0ce0765738 --- /dev/null +++ b/drivers/gpu/drm/gma500/mdfld_output.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicensen + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Authors: + * Thomas Eaton + * Scott Rowe +*/ + +#include "mdfld_output.h" +#include "mdfld_dsi_dpi.h" +#include "mdfld_dsi_output.h" + +#include "tc35876x-dsi-lvds.h" + +int mdfld_get_panel_type(struct drm_device *dev, int pipe) +{ + struct drm_psb_private *dev_priv = dev->dev_private; + return dev_priv->mdfld_panel_id; +} + +static void mdfld_init_panel(struct drm_device *dev, int mipi_pipe, + int p_type) +{ + switch (p_type) { + case TPO_VID: + mdfld_dsi_output_init(dev, mipi_pipe, NULL, + &mdfld_tpo_vid_funcs); + break; + case TC35876X: + tc35876x_init(dev); + mdfld_dsi_output_init(dev, mipi_pipe, NULL, + &mdfld_tc35876x_funcs); + break; + case TMD_VID: + mdfld_dsi_output_init(dev, mipi_pipe, NULL, + &mdfld_tmd_vid_funcs); + break; + case HDMI: +/* if (dev_priv->mdfld_hdmi_present) + mdfld_hdmi_init(dev, &dev_priv->mode_dev); */ + break; + } +} + + +int mdfld_output_init(struct drm_device *dev) +{ + struct drm_psb_private *dev_priv = dev->dev_private; + + /* FIXME: hardcoded for now */ + dev_priv->mdfld_panel_id = TC35876X; + /* MIPI panel 1 */ + mdfld_init_panel(dev, 0, dev_priv->mdfld_panel_id); + /* HDMI panel */ + mdfld_init_panel(dev, 1, HDMI); + return 0; +} + -- cgit v1.2.3 From fda95c2e7304c9d4d7ed8f2590346acbbfff2f99 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Thu, 8 Mar 2012 16:02:50 +0000 Subject: gma500: mdfld_dsi_output_init() drop unused parameter Nobody uses 'config' parameter. Signed-off-by: Kirill A. Shutemov Signed-off-by: Alan Cox Signed-off-by: Dave Airlie --- drivers/gpu/drm/gma500/mdfld_dsi_output.c | 18 ++++++------------ drivers/gpu/drm/gma500/mdfld_dsi_output.h | 1 - drivers/gpu/drm/gma500/mdfld_output.c | 9 +++------ 3 files changed, 9 insertions(+), 19 deletions(-) (limited to 'drivers/gpu/drm/gma500/mdfld_output.c') diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c index 9338c28f3999..88d330d95f2c 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c @@ -511,7 +511,6 @@ gpio_error: */ void mdfld_dsi_output_init(struct drm_device *dev, int pipe, - struct mdfld_dsi_config *config, const struct panel_funcs *p_vid_funcs) { struct mdfld_dsi_config *dsi_config; @@ -538,18 +537,13 @@ void mdfld_dsi_output_init(struct drm_device *dev, dsi_connector->pipe = pipe; - /*set DSI config*/ - if (config) - dsi_config = config; - else { - dsi_config = kzalloc(sizeof(struct mdfld_dsi_config), - GFP_KERNEL); - if (!dsi_config) { - DRM_ERROR("cannot allocate memory for DSI config\n"); - goto dsi_init_err0; - } - mdfld_dsi_get_default_config(dev, dsi_config, pipe); + dsi_config = kzalloc(sizeof(struct mdfld_dsi_config), + GFP_KERNEL); + if (!dsi_config) { + DRM_ERROR("cannot allocate memory for DSI config\n"); + goto dsi_init_err0; } + mdfld_dsi_get_default_config(dev, dsi_config, pipe); dsi_connector->private = dsi_config; diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.h b/drivers/gpu/drm/gma500/mdfld_dsi_output.h index 2cdf666536df..8e4f717e50f2 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.h +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.h @@ -375,7 +375,6 @@ extern void mdfld_dsi_brightness_control(struct drm_device *dev, int pipe, int level); extern void mdfld_dsi_output_init(struct drm_device *dev, int pipe, - struct mdfld_dsi_config *config, const struct panel_funcs *p_vid_funcs); extern void mdfld_dsi_controller_init(struct mdfld_dsi_config *dsi_config, int pipe); diff --git a/drivers/gpu/drm/gma500/mdfld_output.c b/drivers/gpu/drm/gma500/mdfld_output.c index de0ce0765738..c95966bb0c96 100644 --- a/drivers/gpu/drm/gma500/mdfld_output.c +++ b/drivers/gpu/drm/gma500/mdfld_output.c @@ -42,17 +42,14 @@ static void mdfld_init_panel(struct drm_device *dev, int mipi_pipe, { switch (p_type) { case TPO_VID: - mdfld_dsi_output_init(dev, mipi_pipe, NULL, - &mdfld_tpo_vid_funcs); + mdfld_dsi_output_init(dev, mipi_pipe, &mdfld_tpo_vid_funcs); break; case TC35876X: tc35876x_init(dev); - mdfld_dsi_output_init(dev, mipi_pipe, NULL, - &mdfld_tc35876x_funcs); + mdfld_dsi_output_init(dev, mipi_pipe, &mdfld_tc35876x_funcs); break; case TMD_VID: - mdfld_dsi_output_init(dev, mipi_pipe, NULL, - &mdfld_tmd_vid_funcs); + mdfld_dsi_output_init(dev, mipi_pipe, &mdfld_tmd_vid_funcs); break; case HDMI: /* if (dev_priv->mdfld_hdmi_present) -- cgit v1.2.3