From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=68.232.153.233 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796195800; b=wXTyFgGFSre5KOC8KxbYlDKguKbQglSWoBI28DNelVkWhLBQKvKyWLnaYtL0rEHn540A l5wnSA3sZ0bYJJj9wlSr/Lb+lhL5jtD1NLad/uf4Jup+4BUEEhQNpvfw75bkNZ+FmCYQx Lm3AU5ji4PVvo75PU9r0PftG6keTnUGqMrjBK6RIRoOaKZADyc/AM4hkFZI69sf2UgtYM /AURjD41EtzIZBiV4I0IRbUtkjDzN3x7FgdF6uX2WkUFrFrf0zgGg4fEzcng3TtJTXEcT jghvclnMzlSBsHw0+ZSaTnio4x/ZymkgGKSwx5bCz3KejCMyNxyml9ITRTR8jghq7qQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796195800; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-Amp-Result:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer; bh=sWoV05TQEAOxJkLcu3B0y/pHmygsIa4ItfKdxmdm3EI=; b=wnZ77ZT4i7z23p6vyIMyoUZI2XASEWshwe9orA+lkH7GrBX+GbhI96nm/cSaBBZ8EDuG PmJcFxU2kevFb9vtPvmv9zG7+8HBRs6EKV9ZEPFxJYjaQNqx/Jn2wR8T6jYXb9RDTj1nO 3k0pYC7OxeJ/M2AaLJjHnEyQsL7kLKdKlAW/WgHHNB4jTwndEFeVzxI674ucT/qL/09H9 5dl+ShXlHK6AZ2y2O8abVb5uf7mdasmC/0LcqEiyrxBNWEzC6nK9N+Wzx+YEBzfgyVXGg BhosY1EtnPMpRlzt6Y13Et1lLefP6A8NRwf3SaNsqx/7NhXBipvpJ382X2gANE34afg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=VOh+JX2E; arc=none smtp.remote-ip=68.232.153.233 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC36D606A336 for ; Wed, 2 Dec 2026 07:16:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC36D606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=VOh+JX2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1796195799; x=1827731799; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=6RjdEnrd8Mozqj/Qvmo0XAH4IoD01Cprf/+Y2h8NhGo=; b=VOh+JX2Eq56YzgL3J5v9ZGvQ0sO0RX0tuSvtBkvKzjda9AkiIhOQb0x8 XYZ1hWQ5dLBLs1sjl0A8hvdmEwCBoolZDzFk8Bxbb7xBzc9yDgMgVfVt9 HPoWrqHYvRxog4zTn06L5b8KsmOi51Z+ajKDlG0ha2MfjebGwpEjAp/pS tezt2lQqobpsb1mJRzwnRxKb2/N0UxrWktBiy96QwS2axYiaRLJTBgU2s MAIBo3lisCNJtPbKVK8Nud/cOXWyhYPXTNTgwgiFy8suGDEzeXefLJJfc j22zNA0VdHw1xyZi0QrDlD2vhxOhVJJwDD0vvwdXqPnY9/AgWPoRgBujE Q==; X-CSE-ConnectionGUID: H3KgN1nKTXCryZjU2I21yg== X-CSE-MsgGUID: XsjlhRBdR1iR++AeC1lY1Q== X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="78213277" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 02 Dec 2026 00:16:38 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.58; Wed, 2 Dec 2026 00:16:37 -0700 Received: from [127.0.0.1] (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Wed, 2 Dec 2026 00:16:36 -0700 From: Balakrishnan Sambath Date: Wed, 2 Dec 2026 12:46:20 +0530 Subject: [PATCH 14/15] media: microchip-isc: use an unsigned contrast range X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20261202-isc-series-v1-v1-14-4e2f17c0271c@microchip.com> References: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> In-Reply-To: <20261202-isc-series-v1-v1-0-4e2f17c0271c@microchip.com> To: CC: , Balakrishnan Sambath X-Mailer: b4 0.14.3 ISC_CBC_CONTRAST holds an unsigned 12-bit value (CONTRAST bits 11 to 0, ISC_CBC_CONTRAST_MASK), but V4L2_CID_CONTRAST was registered as -2048..2047 on both SAMA5D2 and SAMA7G5. A negative value is masked into the upper half of the field, so contrast=-1 programs 0xfff and the frame clips to white. Register the control as 0..4095 on both. The defaults stay at 256 on SAMA5D2 (DS60001476B, section 52.6.44) and 16 on SAMA7G5. On sama7g5ek with an imx219 at 640x480 YUYV the mean luma of a fixed scene is 33.3, 67.9 and 134.8 at 4, 8 and 16, and every pixel clips at 256. The SAMA7G5 (section 43.7.61) and SAM9X7 (section 52.7.61) datasheets describe the field as 0-4-8, which does not match this scale. The SAMA5D2 unity value of 256 is datasheet-only and has not been measured on hardware. VIDIOC_QUERYCTRL now reports a minimum of 0 and a maximum of 4095 instead of -2048 and 2047. The V4L2 core clamps a negative request to 0 where the old range let it through to the register. Signed-off-by: Balakrishnan Sambath --- drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +- drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c index ef2a0e6d7167..7e5187fed363 100644 --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c @@ -266,7 +266,7 @@ static void isc_sama5d2_config_ctrls(struct isc_device *isc, ctrls->contrast = 256; isc->contrast_ctrl = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, - -2048, 2047, 1, 256); + 0, 4095, 1, 256); } static void isc_sama5d2_config_dpc(struct isc_device *isc) diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c index aec88775d09d..cc65db891ec7 100644 --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c @@ -293,7 +293,7 @@ static void isc_sama7g5_config_ctrls(struct isc_device *isc, ctrls->contrast = 16; isc->contrast_ctrl = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_CONTRAST, - -2048, 2047, 1, 16); + 0, 4095, 1, 16); } static void isc_sama7g5_config_dpc(struct isc_device *isc) -- 2.34.1