aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/mcde/mcde_hw.c
diff options
context:
space:
mode:
authorJimmy Rubin <jimmy.rubin@stericsson.com>2011-02-07 12:07:41 +0100
committerSrinidhi KASAGAR <srinidhi.kasagar@stericsson.com>2011-02-10 05:49:33 +0100
commit2de21e5255bc226843b1ebe45f2cea17b7379d4d (patch)
tree0a9f14a04879984643d653b1fcd2698eb33ba273 /drivers/video/mcde/mcde_hw.c
parent511aa5526a5228778105d82aa22e6e860ab1a1eb (diff)
video: mcde: cleanup of mcde
Concatinates small functions into larger ones (mcde_hw.c) Removes platform_enable and platform_disable for av8100 ST Ericsson ID: ER 322549 Change-Id: Ib4cc3b715112700e702f9f64f2270afb2f0bd22b Signed-off-by: Jimmy Rubin <jimmy.rubin@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/14638 Reviewed-by: Per PERSSON <per.xb.persson@stericsson.com> Reviewed-by: Dan JOHANSSON <dan.johansson@stericsson.com>
Diffstat (limited to 'drivers/video/mcde/mcde_hw.c')
-rw-r--r--drivers/video/mcde/mcde_hw.c148
1 files changed, 49 insertions, 99 deletions
diff --git a/drivers/video/mcde/mcde_hw.c b/drivers/video/mcde/mcde_hw.c
index c098f051a16..8053fd44632 100644
--- a/drivers/video/mcde/mcde_hw.c
+++ b/drivers/video/mcde/mcde_hw.c
@@ -635,18 +635,6 @@ static int disable_mcde_hw(bool force_disable)
return 0;
}
-static int _mcde_chnl_set_video_mode(struct mcde_chnl_state *chnl,
- struct mcde_video_mode *vmode)
-{
- if (chnl == NULL || vmode == NULL)
- return -EINVAL;
-
- chnl->vmode = *vmode;
-
- return 0;
-}
-EXPORT_SYMBOL(mcde_chnl_set_video_mode);
-
static void dpi_video_mode_apply(struct mcde_chnl_state *chnl)
{
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
@@ -1071,7 +1059,7 @@ static irqreturn_t mcde_irq_handler(int irq, void *dev)
return IRQ_HANDLED;
}
-void wait_for_overlay(struct mcde_ovly_state *ovly)
+static void wait_for_overlay(struct mcde_ovly_state *ovly)
{
int ret;
@@ -1088,7 +1076,7 @@ void wait_for_overlay(struct mcde_ovly_state *ovly)
ovly->transactionid_regs);
}
-void wait_for_channel(struct mcde_chnl_state *chnl)
+static void wait_for_channel(struct mcde_chnl_state *chnl)
{
int ret;
@@ -2262,60 +2250,6 @@ static struct mcde_chnl_state *_mcde_chnl_get(enum mcde_chnl chnl_id,
return chnl;
}
-static int _mcde_chnl_set_pixel_format(struct mcde_chnl_state *chnl,
- enum mcde_port_pix_fmt pix_fmt)
-{
- if (!chnl->reserved)
- return -EINVAL;
- chnl->pix_fmt = pix_fmt;
- return 0;
-}
-
-static void _mcde_chnl_set_col_convert(struct mcde_chnl_state *chnl,
- struct mcde_col_convert *col_convert)
-{
- dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
- chnl->col_regs.y_red = col_convert->matrix[0][0];
- chnl->col_regs.y_green = col_convert->matrix[0][1];
- chnl->col_regs.y_blue = col_convert->matrix[0][2];
- chnl->col_regs.cb_red = col_convert->matrix[1][0];
- chnl->col_regs.cb_green = col_convert->matrix[1][1];
- chnl->col_regs.cb_blue = col_convert->matrix[1][2];
- chnl->col_regs.cr_red = col_convert->matrix[2][0];
- chnl->col_regs.cr_green = col_convert->matrix[2][1];
- chnl->col_regs.cr_blue = col_convert->matrix[2][2];
- chnl->col_regs.off_red = col_convert->offset[0];
- chnl->col_regs.off_green = col_convert->offset[1];
- chnl->col_regs.off_blue = col_convert->offset[2];
-}
-
-static int _mcde_chnl_set_rotation(struct mcde_chnl_state *chnl,
- enum mcde_display_rotation rotation, u32 rotbuf1, u32 rotbuf2)
-{
- if (chnl->id != MCDE_CHNL_A && chnl->id != MCDE_CHNL_B)
- return -EINVAL;
-
- chnl->rotation = rotation;
- chnl->rotbuf1 = rotbuf1;
- chnl->rotbuf2 = rotbuf2;
-
- return 0;
-}
-
-static int _mcde_chnl_enable_synchronized_update(struct mcde_chnl_state *chnl,
- bool enable)
-{
- chnl->synchronized_update = enable;
- return 0;
-}
-
-static int _mcde_chnl_set_power_mode(struct mcde_chnl_state *chnl,
- enum mcde_display_power_mode power_mode)
-{
- chnl->power_mode = power_mode;
- return 0;
-}
-
static int _mcde_chnl_apply(struct mcde_chnl_state *chnl)
{
bool roten = false;
@@ -2505,11 +2439,6 @@ static int _mcde_chnl_update(struct mcde_chnl_state *chnl,
return 0;
}
-static void _mcde_chnl_stop_flow(struct mcde_chnl_state *chnl)
-{
- disable_channel(chnl);
-}
-
/* API entry points */
/* MCDE channels */
struct mcde_chnl_state *mcde_chnl_get(enum mcde_chnl chnl_id,
@@ -2527,80 +2456,101 @@ struct mcde_chnl_state *mcde_chnl_get(enum mcde_chnl chnl_id,
int mcde_chnl_set_pixel_format(struct mcde_chnl_state *chnl,
enum mcde_port_pix_fmt pix_fmt)
{
- int ret;
-
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
- ret = _mcde_chnl_set_pixel_format(chnl, pix_fmt);
- dev_vdbg(&mcde_dev->dev, "%s exit with ret %d\n", __func__, ret);
- return ret;
+ if (!chnl->reserved)
+ return -EINVAL;
+ chnl->pix_fmt = pix_fmt;
+
+ dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
+
+ return 0;
}
void mcde_chnl_set_col_convert(struct mcde_chnl_state *chnl,
struct mcde_col_convert *col_convert)
{
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
- _mcde_chnl_set_col_convert(chnl, col_convert);
+
+ chnl->col_regs.y_red = col_convert->matrix[0][0];
+ chnl->col_regs.y_green = col_convert->matrix[0][1];
+ chnl->col_regs.y_blue = col_convert->matrix[0][2];
+ chnl->col_regs.cb_red = col_convert->matrix[1][0];
+ chnl->col_regs.cb_green = col_convert->matrix[1][1];
+ chnl->col_regs.cb_blue = col_convert->matrix[1][2];
+ chnl->col_regs.cr_red = col_convert->matrix[2][0];
+ chnl->col_regs.cr_green = col_convert->matrix[2][1];
+ chnl->col_regs.cr_blue = col_convert->matrix[2][2];
+ chnl->col_regs.off_red = col_convert->offset[0];
+ chnl->col_regs.off_green = col_convert->offset[1];
+ chnl->col_regs.off_blue = col_convert->offset[2];
+
dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
}
int mcde_chnl_set_video_mode(struct mcde_chnl_state *chnl,
struct mcde_video_mode *vmode)
{
- int ret;
-
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
- ret = _mcde_chnl_set_video_mode(chnl, vmode);
- dev_vdbg(&mcde_dev->dev, "%s exit with ret %d\n", __func__, ret);
- return ret;
+ if (chnl == NULL || vmode == NULL)
+ return -EINVAL;
+
+ chnl->vmode = *vmode;
+
+ dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
+
+ return 0;
}
+EXPORT_SYMBOL(mcde_chnl_set_video_mode);
int mcde_chnl_set_rotation(struct mcde_chnl_state *chnl,
enum mcde_display_rotation rotation, u32 rotbuf1, u32 rotbuf2)
{
- int ret;
-
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
if (!chnl->reserved)
return -EINVAL;
- ret = _mcde_chnl_set_rotation(chnl, rotation, rotbuf1, rotbuf2);
- dev_vdbg(&mcde_dev->dev, "%s exit with ret %d\n", __func__, ret);
+ if (chnl->id != MCDE_CHNL_A && chnl->id != MCDE_CHNL_B)
+ return -EINVAL;
- return ret;
+ chnl->rotation = rotation;
+ chnl->rotbuf1 = rotbuf1;
+ chnl->rotbuf2 = rotbuf2;
+
+ dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
+
+ return 0;
}
int mcde_chnl_enable_synchronized_update(struct mcde_chnl_state *chnl,
bool enable)
{
- int ret;
-
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
if (!chnl->reserved)
return -EINVAL;
- ret = _mcde_chnl_enable_synchronized_update(chnl, enable);
+ chnl->synchronized_update = enable;
- dev_vdbg(&mcde_dev->dev, "%s exitwith ret %d\n", __func__, ret);
+ dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
- return ret;
+ return 0;
}
int mcde_chnl_set_power_mode(struct mcde_chnl_state *chnl,
enum mcde_display_power_mode power_mode)
{
- int ret;
dev_vdbg(&mcde_dev->dev, "%s\n", __func__);
if (!chnl->reserved)
return -EINVAL;
- ret = _mcde_chnl_set_power_mode(chnl, power_mode);
+ chnl->power_mode = power_mode;
- dev_vdbg(&mcde_dev->dev, "%s exit with ret %d\n", __func__, ret);
- return ret;
+ dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);
+
+ return 0;
}
int mcde_chnl_apply(struct mcde_chnl_state *chnl)
@@ -2658,7 +2608,7 @@ void mcde_chnl_stop_flow(struct mcde_chnl_state *chnl)
mutex_lock(&mcde_hw_lock);
if (mcde_is_enabled && chnl->enabled)
- _mcde_chnl_stop_flow(chnl);
+ disable_channel(chnl);
mutex_unlock(&mcde_hw_lock);
dev_vdbg(&mcde_dev->dev, "%s exit\n", __func__);