From patchwork Sat Jul 13 15:41:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13732430 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF72749645 for ; Sat, 13 Jul 2024 15:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; cv=none; b=nQpwAi7czUUUVmK/TgvqtcsAeVyZ8j8uPn5A4s9JYjE50tdYfBBg+apOc4zO9TK7aYYQ+TdqJt8u3E41mo113GiOpExLmsk09W3Qrg+aFj/5MB1XIeDyHtpKLD4gj+qzCQEtRpQGARWlUlyIcUV18qoSm214wuzU7xtcsJNkTPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; c=relaxed/simple; bh=4YWMVp9bgeHqtvmhIkQuCeVN0emt4TIi1x+EIhucc14=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uu6EtfmqhFLNRBbO/bIAvTZiEKskVeoiDO5/3SSqrG37oD3mvn6XPvhJYOWID+QqVpYXqgnmp1gFcHXDXz9oqa+bRfzDJm0qaIVvo5Y68NuU40jMgCnUEqzrlNTAysRlvityp+u5LrmAVfUbSpjMTUdOoGAKWr8DynWPsEriUu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=V76d3+Rs; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="V76d3+Rs" Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id B227B87FC7; Sat, 13 Jul 2024 17:43:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1720885385; bh=4Gk0rJZRsQNhaeiMxQENesSasVP+e2i4pe0Jf4Y+sh8=; h=From:To:Cc:Subject:Date:From; b=V76d3+Rs510jgaja2v0bM+LLnkRKeAu/Xf36UUQfvATK5tkA1xnRysRUiw9UueBw9 JNJ3DGaz0Q+LjvPELEgrKPXBVXNCGz/uteBl95vKlqzWhJhleBmf7skXTTxaHYVNr8 Db7McJuuIZ8rRVjYjvP/1jDwiJhw40Q4n1FxgD7+sblo73MBR7aX75PJhhT3aMXLPM p5tVsm4n7AGdhS+9QtjjdFZk/3MJhSsWizqRFxNxaeA61A9pPbEoHSWNBS4Z0xpuc3 tRyCE689j8q9bsVpT2gHVNjGkPU90SiU4ZPYk4xY4z2wjtOIG0mPGVaIArqaFoO0Mz T6ao7PDKotHXg== From: Marek Vasut To: linux-media@vger.kernel.org Cc: Marek Vasut , Mauro Carvalho Chehab , Michael Tretter , Pengutronix Kernel Team Subject: [PATCH 1/3] media: i2c: isl7998x: Enable VACTIVE and HDELAY shadow registers Date: Sat, 13 Jul 2024 17:41:54 +0200 Message-ID: <20240713154242.107903-1-marex@denx.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The VACTIVE and HDELAY shadow registers must be enabled for per channel NTSC/PAL detection to work, enable them. Signed-off-by: Marek Vasut --- Cc: Mauro Carvalho Chehab Cc: Michael Tretter Cc: Pengutronix Kernel Team Cc: linux-media@vger.kernel.org --- drivers/media/i2c/isl7998x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c index c7089035bbc10..5f8f11f7a2c1c 100644 --- a/drivers/media/i2c/isl7998x.c +++ b/drivers/media/i2c/isl7998x.c @@ -312,13 +312,13 @@ static const struct reg_sequence isl7998x_init_seq_1[] = { { ISL7998X_REG_P0_SHORT_DIAG_IRQ_EN, 0xff }, - { ISL7998X_REG_PX_DEC_SDT(0x1), 0x00 }, + { ISL7998X_REG_PX_DEC_SDT(0x1), 0x07 }, { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x1), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x2), 0x00 }, + { ISL7998X_REG_PX_DEC_SDT(0x2), 0x07 }, { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x2), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x3), 0x00 }, + { ISL7998X_REG_PX_DEC_SDT(0x3), 0x07 }, { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x3), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x4), 0x00 }, + { ISL7998X_REG_PX_DEC_SDT(0x4), 0x07 }, { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x4), 0x03 }, { ISL7998X_REG_P5_LI_ENGINE_CTL, 0x00 }, { ISL7998X_REG_P0_SW_RESET_CTL, 0x1f, 10 }, From patchwork Sat Jul 13 15:41:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13732431 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E65DA1304B7 for ; Sat, 13 Jul 2024 15:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; cv=none; b=dSWpDJQEEyQKn/W1jaDG0Pc2wbd6eSfPtXiFgZ07tPSHm2LykH6eYwGwCle1GObbuSuM/D0Qj2dHMojyiywXPpS8z/OzuZctk7v5UR8f7snlRJpU92GtF+YpRgbhZX1vOqSXADapL8PbCEaSeUQN9hVIuWOWqrHmMujOFCQBg0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; c=relaxed/simple; bh=6gGlLxZiOTXf4cPMy6elRiz5RJKvypBSBuumW/7GlAM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NKQwvYppLBN4oC63LawVM2QrX5+Q6npM2qs5CL4VEw59jjEhWHfk+Dgu5poonuuuRxBv6MsMROi2lzZjhvN2UNCraarJYkxJfGCCRyo99k8lsVVruuv7qx7RaELxBRzipvNoDDn4YAigWzQQhfLDCYCvoxZFZTGr9aX1aHugAos= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=F0NlpOk6; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="F0NlpOk6" Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0EFAE886FF; Sat, 13 Jul 2024 17:43:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1720885386; bh=F2gMh1HMGizvLA3op2Ou6zfTSwsvNO4JdCatWbnbzTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F0NlpOk6I/r57otAsMPecKrlWpSFLX6fwpfKcd/URJBKsrqFgK94/tg7gJnFYwxRa m0TaRQkA4f7Y5ZuVMD1l9HzITaABObbMA37U7TBKbD+rR+v63LIzlfxWHD57h0kZzJ pjgfm7dG4gOGkdNoChYHvTK30tvPetJ9GfZ8zEoJqV4xcxL01+OSVADp0gTPDLz6QC yqr2l3va2l/4P2tfbzJjCUX8/PKNtpXcPK5b0MaG+50g/rnikyCpEbqkrh6CEPimin d70fqKQWGQkpxeaGVBXRoecOcOQ/cefTiP5vdm4/BeacWQKlxVqAxWBV2pvhASINf+ TUYz9jFttMnZg== From: Marek Vasut To: linux-media@vger.kernel.org Cc: Marek Vasut , Mauro Carvalho Chehab , Michael Tretter , Pengutronix Kernel Team Subject: [PATCH 2/3] media: i2c: isl7998x: Use 0xf page to program all four pages Date: Sat, 13 Jul 2024 17:41:55 +0200 Message-ID: <20240713154242.107903-2-marex@denx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240713154242.107903-1-marex@denx.de> References: <20240713154242.107903-1-marex@denx.de> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Use page 0xf to program the same value of SDT and short detection settings into all four pages 1..4 . This reduces the I2C traffic slightly. Signed-off-by: Marek Vasut --- Cc: Mauro Carvalho Chehab Cc: Michael Tretter Cc: Pengutronix Kernel Team Cc: linux-media@vger.kernel.org --- drivers/media/i2c/isl7998x.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c index 5f8f11f7a2c1c..7d2799e498520 100644 --- a/drivers/media/i2c/isl7998x.c +++ b/drivers/media/i2c/isl7998x.c @@ -312,14 +312,8 @@ static const struct reg_sequence isl7998x_init_seq_1[] = { { ISL7998X_REG_P0_SHORT_DIAG_IRQ_EN, 0xff }, - { ISL7998X_REG_PX_DEC_SDT(0x1), 0x07 }, - { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x1), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x2), 0x07 }, - { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x2), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x3), 0x07 }, - { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x3), 0x03 }, - { ISL7998X_REG_PX_DEC_SDT(0x4), 0x07 }, - { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0x4), 0x03 }, + { ISL7998X_REG_PX_DEC_SDT(0xf), 0x07 }, + { ISL7998X_REG_PX_DEC_SHORT_DET_CTL_1(0xf), 0x03 }, { ISL7998X_REG_P5_LI_ENGINE_CTL, 0x00 }, { ISL7998X_REG_P0_SW_RESET_CTL, 0x1f, 10 }, { ISL7998X_REG_P0_IO_BUFFER_CTL, 0x00 }, From patchwork Sat Jul 13 15:41:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13732432 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AE2E139D1E for ; Sat, 13 Jul 2024 15:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; cv=none; b=vGvTYvceItZLGcM68qcPFqTBMA7Jhv9ArgT7mI5oncGUJPgOWHRdoo34UwebcleS46GNmK8I7oil3ar8qMddWe3bQumpaK349rznVVcVYTPc/OVWt4YtGBcvI8Wtxgofy3yo36WkBwBwhaDBp4gsy0LCeDfnwFwScfpy3A9FI1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720885389; c=relaxed/simple; bh=HEc1KoxYYIGW0f3G7ayt/Mv1IZKt4p0KavnHqnHVlOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=srnIaH/sMlcI1yY8MWIDLCT8IvEbLdSkKsFrrOfYFIDIJRiQy4FFcCWh/GTtM4rqfJsVDrbnBIM3ENtXV2lFqNrYXDp8my6Q1h4NRE9YcaehGYsfZDtyeHrBdZ0mcF547st9brBqubBe4PNsflz563LS80yK+av8IAiPARglFyA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=To17i5pZ; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="To17i5pZ" Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 5874D887BF; Sat, 13 Jul 2024 17:43:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1720885386; bh=NV0PygndnXlbyLZp9hp02uWg0pHsWZxFuJG/yzxUuO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=To17i5pZiuRyPvVfYKXetxZRZ843dCCp/Xcu99C5mo1FXyoE8Am6L2sYSH/opoCsg SQgxw2PE08SR6C4s72g2+wVCvD3gQECo3GKfWq+DZARTA/kKVXAKXKJ38SF5K0Yez4 S0M70tzgi6r4vNQCgGdIKgson+db8btVXgkfX1vhViCgmUwA1DumJksxql1dieeGdW JSOIoasuzmydUyBTEd56WHKKmBJzQvwpPvw8tSvaRvtvs6it8CErJhQZdcT3TpukB6 YB66+PktoxU5FIui6SlbopjT2hJ879B3dqg5FD5rp5CtOa14BcVGnmqWX5SWJeWxWW Rv8bskCEA/twg== From: Marek Vasut To: linux-media@vger.kernel.org Cc: Marek Vasut , Mauro Carvalho Chehab , Michael Tretter , Pengutronix Kernel Team Subject: [PATCH 3/3] media: i2c: isl7998x: Implement get_mbus_config Date: Sat, 13 Jul 2024 17:41:56 +0200 Message-ID: <20240713154242.107903-3-marex@denx.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240713154242.107903-1-marex@denx.de> References: <20240713154242.107903-1-marex@denx.de> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This is used e.g. by imx6-mipi-csi2.c to determine the CSI2 lane count. Implement the callback in isl7998x driver so it can be used with i.MX6 CSI2 receiver. Signed-off-by: Marek Vasut --- Cc: Mauro Carvalho Chehab Cc: Michael Tretter Cc: Pengutronix Kernel Team Cc: linux-media@vger.kernel.org --- drivers/media/i2c/isl7998x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c index 7d2799e498520..560f4845b5e62 100644 --- a/drivers/media/i2c/isl7998x.c +++ b/drivers/media/i2c/isl7998x.c @@ -1045,6 +1045,17 @@ static int isl7998x_set_fmt(struct v4l2_subdev *sd, return 0; } +static int isl7998x_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_mbus_config *cfg) +{ + struct isl7998x *isl7998x = sd_to_isl7998x(sd); + + cfg->type = V4L2_MBUS_CSI2_DPHY; + cfg->bus.mipi_csi2.num_data_lanes = isl7998x->nr_mipi_lanes; + + return 0; +} + static int isl7998x_set_ctrl(struct v4l2_ctrl *ctrl) { struct isl7998x *isl7998x = container_of(ctrl->handler, @@ -1104,6 +1115,7 @@ static const struct v4l2_subdev_pad_ops isl7998x_subdev_pad_ops = { .enum_frame_size = isl7998x_enum_frame_size, .get_fmt = isl7998x_get_fmt, .set_fmt = isl7998x_set_fmt, + .get_mbus_config = isl7998x_get_mbus_config, }; static const struct v4l2_subdev_ops isl7998x_subdev_ops = {