Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 2ffd48f2e7ae ("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 <linux@treblig.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241226022752.219399-7-linux@treblig.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Dr. David Alan Gilbert and committed by
Dmitry Baryshkov
c687c314 27985c86

-113
-108
drivers/gpu/ipu-v3/ipu-csi.c
··· 186 186 } 187 187 188 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 - 214 - /* 215 189 * Find the CSI data format and data width for the given V4L2 media 216 190 * bus pixel format code. 217 191 */ ··· 512 538 } 513 539 EXPORT_SYMBOL_GPL(ipu_csi_init_interface); 514 540 515 - bool ipu_csi_is_interlaced(struct ipu_csi *csi) 516 - { 517 - unsigned long flags; 518 - u32 sensor_protocol; 519 - 520 - spin_lock_irqsave(&csi->lock, flags); 521 - sensor_protocol = 522 - (ipu_csi_read(csi, CSI_SENS_CONF) & 523 - CSI_SENS_CONF_SENS_PRTCL_MASK) >> 524 - CSI_SENS_CONF_SENS_PRTCL_SHIFT; 525 - spin_unlock_irqrestore(&csi->lock, flags); 526 - 527 - switch (sensor_protocol) { 528 - case IPU_CSI_CLK_MODE_GATED_CLK: 529 - case IPU_CSI_CLK_MODE_NONGATED_CLK: 530 - case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE: 531 - case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR: 532 - case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR: 533 - return false; 534 - case IPU_CSI_CLK_MODE_CCIR656_INTERLACED: 535 - case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_DDR: 536 - case IPU_CSI_CLK_MODE_CCIR1120_INTERLACED_SDR: 537 - return true; 538 - default: 539 - dev_err(csi->ipu->dev, 540 - "CSI %d sensor protocol unsupported\n", csi->id); 541 - return false; 542 - } 543 - } 544 - EXPORT_SYMBOL_GPL(ipu_csi_is_interlaced); 545 - 546 - void ipu_csi_get_window(struct ipu_csi *csi, struct v4l2_rect *w) 547 - { 548 - unsigned long flags; 549 - u32 reg; 550 - 551 - spin_lock_irqsave(&csi->lock, flags); 552 - 553 - reg = ipu_csi_read(csi, CSI_ACT_FRM_SIZE); 554 - w->width = (reg & 0xFFFF) + 1; 555 - w->height = (reg >> 16 & 0xFFFF) + 1; 556 - 557 - reg = ipu_csi_read(csi, CSI_OUT_FRM_CTRL); 558 - w->left = (reg & CSI_HSC_MASK) >> CSI_HSC_SHIFT; 559 - w->top = (reg & CSI_VSC_MASK) >> CSI_VSC_SHIFT; 560 - 561 - spin_unlock_irqrestore(&csi->lock, flags); 562 - } 563 - EXPORT_SYMBOL_GPL(ipu_csi_get_window); 564 - 565 541 void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w) 566 542 { 567 543 unsigned long flags; ··· 547 623 spin_unlock_irqrestore(&csi->lock, flags); 548 624 } 549 625 EXPORT_SYMBOL_GPL(ipu_csi_set_downsize); 550 - 551 - void ipu_csi_set_test_generator(struct ipu_csi *csi, bool active, 552 - u32 r_value, u32 g_value, u32 b_value, 553 - u32 pix_clk) 554 - { 555 - unsigned long flags; 556 - u32 ipu_clk = clk_get_rate(csi->clk_ipu); 557 - u32 temp; 558 - 559 - spin_lock_irqsave(&csi->lock, flags); 560 - 561 - temp = ipu_csi_read(csi, CSI_TST_CTRL); 562 - 563 - if (!active) { 564 - temp &= ~CSI_TEST_GEN_MODE_EN; 565 - ipu_csi_write(csi, temp, CSI_TST_CTRL); 566 - } else { 567 - /* Set sensb_mclk div_ratio */ 568 - ipu_csi_set_testgen_mclk(csi, pix_clk, ipu_clk); 569 - 570 - temp &= ~(CSI_TEST_GEN_R_MASK | CSI_TEST_GEN_G_MASK | 571 - CSI_TEST_GEN_B_MASK); 572 - temp |= CSI_TEST_GEN_MODE_EN; 573 - temp |= (r_value << CSI_TEST_GEN_R_SHIFT) | 574 - (g_value << CSI_TEST_GEN_G_SHIFT) | 575 - (b_value << CSI_TEST_GEN_B_SHIFT); 576 - ipu_csi_write(csi, temp, CSI_TST_CTRL); 577 - } 578 - 579 - spin_unlock_irqrestore(&csi->lock, flags); 580 - } 581 - EXPORT_SYMBOL_GPL(ipu_csi_set_test_generator); 582 626 583 627 int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc, 584 628 struct v4l2_mbus_framefmt *mbus_fmt)
-5
include/video/imx-ipu-v3.h
··· 361 361 const struct v4l2_mbus_config *mbus_cfg, 362 362 const struct v4l2_mbus_framefmt *infmt, 363 363 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); 366 364 void ipu_csi_set_window(struct ipu_csi *csi, struct v4l2_rect *w); 367 365 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); 371 366 int ipu_csi_set_mipi_datatype(struct ipu_csi *csi, u32 vc, 372 367 struct v4l2_mbus_framefmt *mbus_fmt); 373 368 int ipu_csi_set_skip_smfc(struct ipu_csi *csi, u32 skip,