aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/platform/hisi/isp/isp-sr.c
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2018-11-23 21:22:37 +0530
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2018-11-23 21:22:37 +0530
commite89b90550f3bfdf483d472e0723bcb8b57ecdd34 (patch)
tree640081094a96332d3a4b94732e881ed23e2c1a4c /drivers/media/platform/hisi/isp/isp-sr.c
parentd68335c072a803e002b21519e5ca27269e8a0bfe (diff)
download96b-common-hikey_v4l2_4.15.tar.gz
media: hisi: ISP: Add video device and some cleanupshikey_v4l2_4.15
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'drivers/media/platform/hisi/isp/isp-sr.c')
-rw-r--r--drivers/media/platform/hisi/isp/isp-sr.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/media/platform/hisi/isp/isp-sr.c b/drivers/media/platform/hisi/isp/isp-sr.c
index 14f1ac4d4cef..e34b6baaf99f 100644
--- a/drivers/media/platform/hisi/isp/isp-sr.c
+++ b/drivers/media/platform/hisi/isp/isp-sr.c
@@ -22,16 +22,18 @@
void isp_sr_config(struct sr_device *sr)
{
+ struct isp *isp = sr->isp;
int data_type = 1;
union U_ID_ROUTER_1 reg1;
union U_REFORMAT reg;
+ pr_info("%s: %d\n", __func__, __LINE__);
isp_writel(sr->base, STREAM_ROUTER_CSIFILTER_A_REG,
(0 << 6) | (YUV_DT_422_8BITS << 0));
reg1.u32 = isp_readl(sr->base, STREAM_ROUTER_ID_ROUTER_1_REG);
reg1.bits.idr_enable_6 = 1;
- reg1.bits.idr_input_stream_6 = (0 << 2) | (0 << 0);
+ reg1.bits.idr_input_stream_6 = (isp->csiphy_id << 2) | (0 << 0);
isp_writel(sr->base, STREAM_ROUTER_ID_ROUTER_1_REG, reg1.u32);
reg.u32 = 0;
@@ -46,6 +48,7 @@ void isp_sr_config(struct sr_device *sr)
void isp_sr_go(struct sr_device *sr, unsigned int go_bit)
{
+ pr_info("%s: %d\n", __func__, __LINE__);
isp_writel(sr->base, STREAM_ROUTER_CSIFILTER_GO_REG, go_bit);
}
@@ -75,6 +78,7 @@ static int sr_set_stream(struct v4l2_subdev *sd, int enable)
struct sr_device *sr = v4l2_get_subdevdata(sd);
int ret = 0;
+ pr_info("%s: %d\n", __func__, __LINE__);
enable_irq(sr->irq_frproc0);
isp_config_smmu_bypass(sr->isp);
isp_sr_config(sr);
@@ -102,13 +106,14 @@ static int sr_init_formats(struct v4l2_subdev *sd,
irqreturn_t isp_frproc0_handler(int irq, void *dev)
{
+ pr_info("%s: %d\n", __func__, __LINE__);
struct sr_device *sr = dev;
struct isp *isp = sr->isp;
unsigned int val = isp_clear_irq(sr->isp, IRQ_MERGER_FRPROC_0);
if (val & (1 << IRQ_MERGER_SR_4_CVDR_RT_EOF_VPWR_23_OFFSET)) {
// FIXME: Use CSI index
- isp_sr_go(sr, (1 << 0));
+ isp_sr_go(sr, (1 << (4 * isp->csiphy_id)));
isp->frame_num++;
}
@@ -230,12 +235,6 @@ int isp_sr_register_entity(struct sr_device *sr,
ISP_SR_NAME);
v4l2_set_subdevdata(sd, sr);
- ret = sr_init_formats(sd, NULL);
- if (ret < 0) {
- dev_err(dev, "Failed to init format: %d\n", ret);
- return ret;
- }
-
pads[ISP_CSIPHY_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
pads[ISP_CSIPHY_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;