Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35f29248 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab
Browse files

[media] s5p-fimc: Clean up capture enable/disable helpers



The FIMC FIFO output is not supported in the driver due to
some hardware issues thus we can remove some code as out_path
is always FIMC_IO_DMA.

Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a62082ff
Loading
Loading
Loading
Loading
+16 −22
Original line number Original line Diff line number Diff line
@@ -344,30 +344,31 @@ void fimc_hw_set_mainscaler(struct fimc_ctx *ctx)
	}
	}
}
}


void fimc_hw_en_capture(struct fimc_ctx *ctx)
void fimc_hw_enable_capture(struct fimc_ctx *ctx)
{
{
	struct fimc_dev *dev = ctx->fimc_dev;
	struct fimc_dev *dev = ctx->fimc_dev;
	u32 cfg;


	u32 cfg = readl(dev->regs + FIMC_REG_CIIMGCPT);
	cfg = readl(dev->regs + FIMC_REG_CIIMGCPT);

	cfg |= FIMC_REG_CIIMGCPT_CPT_FREN_ENABLE;
	if (ctx->out_path == FIMC_IO_DMA) {
		/* one shot mode */
		cfg |= FIMC_REG_CIIMGCPT_CPT_FREN_ENABLE |
			FIMC_REG_CIIMGCPT_IMGCPTEN;
	} else {
		/* Continuous frame capture mode (freerun). */
		cfg &= ~(FIMC_REG_CIIMGCPT_CPT_FREN_ENABLE |
			 FIMC_REG_CIIMGCPT_CPT_FRMOD_CNT);
		cfg |= FIMC_REG_CIIMGCPT_IMGCPTEN;
	}


	if (ctx->scaler.enabled)
	if (ctx->scaler.enabled)
		cfg |= FIMC_REG_CIIMGCPT_IMGCPTEN_SC;
		cfg |= FIMC_REG_CIIMGCPT_IMGCPTEN_SC;
	else
		cfg &= FIMC_REG_CIIMGCPT_IMGCPTEN_SC;


	cfg |= FIMC_REG_CIIMGCPT_IMGCPTEN;
	cfg |= FIMC_REG_CIIMGCPT_IMGCPTEN;
	writel(cfg, dev->regs + FIMC_REG_CIIMGCPT);
	writel(cfg, dev->regs + FIMC_REG_CIIMGCPT);
}
}


void fimc_hw_disable_capture(struct fimc_dev *dev)
{
	u32 cfg = readl(dev->regs + FIMC_REG_CIIMGCPT);
	cfg &= ~(FIMC_REG_CIIMGCPT_IMGCPTEN |
		 FIMC_REG_CIIMGCPT_IMGCPTEN_SC);
	writel(cfg, dev->regs + FIMC_REG_CIIMGCPT);
}

void fimc_hw_set_effect(struct fimc_ctx *ctx)
void fimc_hw_set_effect(struct fimc_ctx *ctx)
{
{
	struct fimc_dev *dev = ctx->fimc_dev;
	struct fimc_dev *dev = ctx->fimc_dev;
@@ -737,13 +738,6 @@ void fimc_hw_activate_input_dma(struct fimc_dev *dev, bool on)
	writel(cfg, dev->regs + FIMC_REG_MSCTRL);
	writel(cfg, dev->regs + FIMC_REG_MSCTRL);
}
}


void fimc_hw_dis_capture(struct fimc_dev *dev)
{
	u32 cfg = readl(dev->regs + FIMC_REG_CIIMGCPT);
	cfg &= ~(FIMC_REG_CIIMGCPT_IMGCPTEN | FIMC_REG_CIIMGCPT_IMGCPTEN_SC);
	writel(cfg, dev->regs + FIMC_REG_CIIMGCPT);
}

/* Return an index to the buffer actually being written. */
/* Return an index to the buffer actually being written. */
s32 fimc_hw_get_frame_index(struct fimc_dev *dev)
s32 fimc_hw_get_frame_index(struct fimc_dev *dev)
{
{
@@ -776,13 +770,13 @@ s32 fimc_hw_get_prev_frame_index(struct fimc_dev *dev)
void fimc_activate_capture(struct fimc_ctx *ctx)
void fimc_activate_capture(struct fimc_ctx *ctx)
{
{
	fimc_hw_enable_scaler(ctx->fimc_dev, ctx->scaler.enabled);
	fimc_hw_enable_scaler(ctx->fimc_dev, ctx->scaler.enabled);
	fimc_hw_en_capture(ctx);
	fimc_hw_enable_capture(ctx);
}
}


void fimc_deactivate_capture(struct fimc_dev *fimc)
void fimc_deactivate_capture(struct fimc_dev *fimc)
{
{
	fimc_hw_en_lastirq(fimc, true);
	fimc_hw_en_lastirq(fimc, true);
	fimc_hw_dis_capture(fimc);
	fimc_hw_disable_capture(fimc);
	fimc_hw_enable_scaler(fimc, false);
	fimc_hw_enable_scaler(fimc, false);
	fimc_hw_en_lastirq(fimc, false);
	fimc_hw_en_lastirq(fimc, false);
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -287,7 +287,7 @@ void fimc_hw_en_lastirq(struct fimc_dev *fimc, int enable);
void fimc_hw_en_irq(struct fimc_dev *fimc, int enable);
void fimc_hw_en_irq(struct fimc_dev *fimc, int enable);
void fimc_hw_set_prescaler(struct fimc_ctx *ctx);
void fimc_hw_set_prescaler(struct fimc_ctx *ctx);
void fimc_hw_set_mainscaler(struct fimc_ctx *ctx);
void fimc_hw_set_mainscaler(struct fimc_ctx *ctx);
void fimc_hw_en_capture(struct fimc_ctx *ctx);
void fimc_hw_enable_capture(struct fimc_ctx *ctx);
void fimc_hw_set_effect(struct fimc_ctx *ctx);
void fimc_hw_set_effect(struct fimc_ctx *ctx);
void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx);
void fimc_hw_set_rgb_alpha(struct fimc_ctx *ctx);
void fimc_hw_set_in_dma(struct fimc_ctx *ctx);
void fimc_hw_set_in_dma(struct fimc_ctx *ctx);
@@ -306,7 +306,7 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
void fimc_hw_clear_irq(struct fimc_dev *dev);
void fimc_hw_clear_irq(struct fimc_dev *dev);
void fimc_hw_enable_scaler(struct fimc_dev *dev, bool on);
void fimc_hw_enable_scaler(struct fimc_dev *dev, bool on);
void fimc_hw_activate_input_dma(struct fimc_dev *dev, bool on);
void fimc_hw_activate_input_dma(struct fimc_dev *dev, bool on);
void fimc_hw_dis_capture(struct fimc_dev *dev);
void fimc_hw_disable_capture(struct fimc_dev *dev);
s32 fimc_hw_get_frame_index(struct fimc_dev *dev);
s32 fimc_hw_get_frame_index(struct fimc_dev *dev);
s32 fimc_hw_get_prev_frame_index(struct fimc_dev *dev);
s32 fimc_hw_get_prev_frame_index(struct fimc_dev *dev);
void fimc_activate_capture(struct fimc_ctx *ctx);
void fimc_activate_capture(struct fimc_ctx *ctx);