Skip to content

Commit 8bfc6e7

Browse files
committed
Move lane selection into the PLL setup and drop overlay changes
1 parent 4a74823 commit 8bfc6e7

File tree

4 files changed

+11
-127
lines changed

4 files changed

+11
-127
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
130130
i2s-master-dac.dtbo \
131131
ilitek251x.dtbo \
132132
imx219.dtbo \
133-
imx219_4lane.dtbo \
134133
imx258.dtbo \
135134
imx290.dtbo \
136135
imx296.dtbo \

arch/arm/boot/dts/overlays/imx219_4lane-overlay.dts

Lines changed: 0 additions & 89 deletions
This file was deleted.

arch/arm/boot/dts/overlays/imx219_4lane.dtsi

Lines changed: 0 additions & 27 deletions
This file was deleted.

drivers/media/i2c/imx219.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static const struct cci_reg_sequence imx219_common_regs[] = {
248248
{ IMX219_REG_EXCK_FREQ, IMX219_EXCK_FREQ(IMX219_XCLK_FREQ / 1000000) },
249249
};
250250

251-
static const struct cci_reg_sequence imx219_pll[] = {
251+
static const struct cci_reg_sequence imx219_2lane_regs[] = {
252252
/* PLL Clock Table */
253253
{ IMX219_REG_VTPXCK_DIV, 5 },
254254
{ IMX219_REG_VTSYCK_DIV, 1 },
@@ -257,9 +257,12 @@ static const struct cci_reg_sequence imx219_pll[] = {
257257
{ IMX219_REG_PLL_VT_MPY, 57 },
258258
{ IMX219_REG_OPSYCK_DIV, 1 },
259259
{ IMX219_REG_PLL_OP_MPY, 114 },
260+
261+
/* 2-Lane CSI Mode */
262+
{ IMX219_REG_CSI_LANE_MODE, IMX219_CSI_2_LANE_MODE },
260263
};
261264

262-
static const struct cci_reg_sequence imx219_pll_4lane[] = {
265+
static const struct cci_reg_sequence imx219_4lane_regs[] = {
263266
/* PLL Clock Table */
264267
{ IMX219_REG_VTPXCK_DIV, 5 },
265268
{ IMX219_REG_VTSYCK_DIV, 1 },
@@ -268,6 +271,9 @@ static const struct cci_reg_sequence imx219_pll_4lane[] = {
268271
{ IMX219_REG_PLL_VT_MPY, 88 },
269272
{ IMX219_REG_OPSYCK_DIV, 1 },
270273
{ IMX219_REG_PLL_OP_MPY, 91 },
274+
275+
/* 4-Lane CSI Mode */
276+
{ IMX219_REG_CSI_LANE_MODE, IMX219_CSI_4_LANE_MODE },
271277
};
272278

273279
/*
@@ -954,16 +960,11 @@ static int imx219_get_selection(struct v4l2_subdev *sd,
954960

955961
static int imx219_configure_lanes(struct imx219 *imx219)
956962
{
957-
int ret;
958963
/* Write the appropriate PLL settings for the number of MIPI lanes */
959-
ret = cci_multi_reg_write(imx219->regmap,
960-
imx219->lanes == 2 ? imx219_pll : imx219_pll_4lane,
961-
imx219->lanes == 2 ? ARRAY_SIZE(imx219_pll) : ARRAY_SIZE(imx219_pll_4lane),
964+
return cci_multi_reg_write(imx219->regmap,
965+
imx219->lanes == 2 ? imx219_2lane_regs : imx219_4lane_regs,
966+
imx219->lanes == 2 ? ARRAY_SIZE(imx219_2lane_regs) : ARRAY_SIZE(imx219_4lane_regs),
962967
NULL);
963-
964-
return cci_write(imx219->regmap, IMX219_REG_CSI_LANE_MODE,
965-
imx219->lanes == 2 ? IMX219_CSI_2_LANE_MODE :
966-
IMX219_CSI_4_LANE_MODE, NULL);
967968
};
968969

969970
static int imx219_start_streaming(struct imx219 *imx219,

0 commit comments

Comments
 (0)