Skip to content

Commit c687c31

Browse files
Dr. David Alan Gilbertlumag
authored andcommitted
gpu: ipu-v3: ipu-csi: Remove unused functions
ipu_csi_get_window(), ipu_csi_is_interlaced() and ipu_csi_set_test_generator() were added in 2014 by commit 2ffd48f ("gpu: ipu-v3: Add Camera Sensor Interface unit") but have remained unused. Remove them. ipu_csi_set_testgen_mclk() is now unused. Remove it. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 27985c8 commit c687c31

File tree

2 files changed

+0
-113
lines changed

2 files changed

+0
-113
lines changed

drivers/gpu/ipu-v3/ipu-csi.c

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -185,32 +185,6 @@ static inline void ipu_csi_write(struct ipu_csi *csi, u32 value,
185185
writel(value, csi->base + offset);
186186
}
187187

188-
/*
189-
* Set mclk division ratio for generating test mode mclk. Only used
190-
* for test generator.
191-
*/
192-
static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk,
193-
u32 ipu_clk)
194-
{
195-
u32 temp;
196-
int div_ratio;
197-
198-
div_ratio = (ipu_clk / pixel_clk) - 1;
199-
200-
if (div_ratio > 0xFF || div_ratio < 0) {
201-
dev_err(csi->ipu->dev,
202-
"value of pixel_clk extends normal range\n");
203-
return -EINVAL;
204-
}
205-
206-
temp = ipu_csi_read(csi, CSI_SENS_CONF);
207-
temp &= ~CSI_SENS_CONF_DIVRATIO_MASK;
208-
ipu_csi_write(csi, temp | (div_ratio << CSI_SENS_CONF_DIVRATIO_SHIFT),
209-
CSI_SENS_CONF);
210-
211-
return 0;
212-
}
213-
214188
/*
215189
* Find the CSI data format and data width for the given V4L2 media
216190
* bus pixel format code.
@@ -538,56 +512,6 @@ int ipu_csi_init_interface(struct ipu_csi *csi,
538512
}
539513
EXPORT_SYMBOL_GPL(ipu_csi_init_interface);
540514

541-
bool ipu_csi_is_interlaced(struct ipu_csi *csi)
542-
{
543-
unsigned long flags;
544-
u32 sensor_protocol;
545-
546-
spin_lock_irqsave(&csi->lock, flags);
547-
sensor_protocol =
548-
(ipu_csi_read(csi, CSI_SENS_CONF) &
549-
CSI_SENS_CONF_SENS_PRTCL_MASK) >>
550-
CSI_SENS_CONF_SENS_PRTCL_SHIFT;
551-
spin_unlock_irqrestore(&csi->lock, flags);
552-
553-
switch (sensor_protocol) {
554-
case IPU_CSI_CLK_MODE_GATED_CLK:
555-
case IPU_CSI_CLK_MODE_NONGATED_CLK:
556-
case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE:
557-
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR:
558-
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR:
559-
return false;
560-
case IPU_CSI_CLK_MODE_CCIR656_INTERLACED:
561-
case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_DDR:
562-
case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_SDR:
563-
return true;
564-
default:
565-
dev_err(csi->ipu->dev,
566-
"CSI %d sensor protocol unsupported\n", csi->id);
567-
return false;
568-
}
569-
}
570-
EXPORT_SYMBOL_GPL(ipu_csi_is_interlaced);
571-
572-
void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w)
573-
{
574-
unsigned long flags;
575-
u32 reg;
576-
577-
spin_lock_irqsave(&csi->lock, flags);
578-
579-
reg = ipu_csi_read(csi, CSI_ACT_FRM_SIZE);
580-
w->width = (reg & 0xFFFF) + 1;
581-
w->height = (reg >> 16 & 0xFFFF) + 1;
582-
583-
reg = ipu_csi_read(csi, CSI_OUT_FRM_CTRL);
584-
w->left = (reg & CSI_HSC_MASK) >> CSI_HSC_SHIFT;
585-
w->top = (reg & CSI_VSC_MASK) >> CSI_VSC_SHIFT;
586-
587-
spin_unlock_irqrestore(&csi->lock, flags);
588-
}
589-
EXPORT_SYMBOL_GPL(ipu_csi_get_window);
590-
591515
void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w)
592516
{
593517
unsigned long flags;
@@ -624,38 +548,6 @@ void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert)
624548
}
625549
EXPORT_SYMBOL_GPL(ipu_csi_set_downsize);
626550

627-
void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
628-
u32 r_value, u32 g_value, u32 b_value,
629-
u32 pix_clk)
630-
{
631-
unsigned long flags;
632-
u32 ipu_clk = clk_get_rate(csi->clk_ipu);
633-
u32 temp;
634-
635-
spin_lock_irqsave(&csi->lock, flags);
636-
637-
temp = ipu_csi_read(csi, CSI_TST_CTRL);
638-
639-
if (!active) {
640-
temp &= ~CSI_TEST_GEN_MODE_EN;
641-
ipu_csi_write(csi, temp, CSI_TST_CTRL);
642-
} else {
643-
/* Set sensb_mclk div_ratio */
644-
ipu_csi_set_testgen_mclk(csi, pix_clk, ipu_clk);
645-
646-
temp &= ~(CSI_TEST_GEN_R_MASK | CSI_TEST_GEN_G_MASK |
647-
CSI_TEST_GEN_B_MASK);
648-
temp |= CSI_TEST_GEN_MODE_EN;
649-
temp |= (r_value << CSI_TEST_GEN_R_SHIFT) |
650-
(g_value << CSI_TEST_GEN_G_SHIFT) |
651-
(b_value << CSI_TEST_GEN_B_SHIFT);
652-
ipu_csi_write(csi, temp, CSI_TST_CTRL);
653-
}
654-
655-
spin_unlock_irqrestore(&csi->lock, flags);
656-
}
657-
EXPORT_SYMBOL_GPL(ipu_csi_set_test_generator);
658-
659551
int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc,
660552
struct v4l2_mbus_framefmt *mbus_fmt)
661553
{

include/video/imx-ipu-v3.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,8 @@ int ipu_csi_init_interface(struct ipu_csi *csi,
361361
const struct v4l2_mbus_config *mbus_cfg,
362362
const struct v4l2_mbus_framefmt *infmt,
363363
const struct v4l2_mbus_framefmt *outfmt);
364-
bool ipu_csi_is_interlaced(struct ipu_csi *csi);
365-
void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w);
366364
void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w);
367365
void ipu_csi_set_downsize(struct ipu_csi *csi, bool horiz, bool vert);
368-
void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active,
369-
u32 r_value, u32 g_value, u32 b_value,
370-
u32 pix_clk);
371366
int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc,
372367
struct v4l2_mbus_framefmt *mbus_fmt);
373368
int ipu_csi_set_skip_smfc(struct ipu_csi *csi, u32 skip,

0 commit comments

Comments
 (0)