From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F1CC481AA9 for ; Wed, 1 Jul 2026 12:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782908598; cv=none; b=kGdbhTVTyW1QBsDo4HlJwUwucgg/SyIlF7W0SGbvVN3gER/Xgv2PuSqDF7tXFBrnXP57ox2qQXDZnxodeovF27bP6YqZREppagtqgE2hmlBhzSXADjR/m5MjRGcdLkkdYP4jkass0lfhQsUKPPp1gOXCUi2C95pvDXmBtG+vDYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782908598; c=relaxed/simple; bh=/WKe5AKm8MVYiYUtro0EqIfc1mOGdTQx7I/XvrxifTo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sU5LfGCRr1cnW/lblLGegmWPC4NplyreWlwArMM9ZFfk339CJLAr8Guhw1OCQoXyr2ld3apk+LzSGVXOsidfSi3KxtrF8UX5AIoTzHBniD0ng35tNRX6e+tVagdr7HAB7R/iwceabjdbq1l/EY4mGeqqytPqYbieBrjuM6XoMis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=h8onCovd; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="h8onCovd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782908597; x=1814444597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/WKe5AKm8MVYiYUtro0EqIfc1mOGdTQx7I/XvrxifTo=; b=h8onCovdOhKfSIRGfm8FjIVjEKi63PjwnDuig5m66/tpaii0NmQxg2tE 0mUknhsVg5XDlHms8pFvM7RsvTruckeLLR7jq12B7mxpaxT7pm+zS2doG wUQMxvGWxCmrr9DZL1ejlV80W08PvHQ/QVu9fFmFjO7F1equnxWlBopfD m7roRsumkoUJQcyERvvx1NLE8yaPZdY3hyrjcNCAVGiaV3t8FyEINXND2 6VCFmuNzwG9kkuwTst1w0hz0JVG5q3+N8LILhNIeVoW/InCVPHfNI2RTr 1qFOgSHsyzkEM0OcNxVg1TcdRfiUtu7Io34SWs/Kq3idyw4RNVZD6wzRz g==; X-CSE-ConnectionGUID: xZczwsOrRFiQqDZ518UokQ== X-CSE-MsgGUID: P25QCMcTR1yxdTDWJKeu7w== X-IronPort-AV: E=McAfee;i="6800,10657,11833"; a="94239021" X-IronPort-AV: E=Sophos;i="6.25,141,1779174000"; d="scan'208";a="94239021" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 05:23:12 -0700 X-CSE-ConnectionGUID: mH3dMDqrQQuT86tYHHOtMA== X-CSE-MsgGUID: 1mRKXxP9QQasIsRlUd5mYg== X-ExtLoop1: 1 Received: from pgcooper-mobl3.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.62]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 05:23:04 -0700 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id CFD05121C19; Wed, 01 Jul 2026 15:23:04 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1weu1S-00000007FkV-2SDJ; Wed, 01 Jul 2026 15:26:34 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com, Prabhakar , Kate Hsuan , Dave Stevenson , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , Stefan Klug , Mirela Rabulea , =?UTF-8?q?Andr=C3=A9=20Apitzsch?= , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , "Ng, Khai Wen" , Jai Luthra , Rishikesh Donadkar Subject: [PATCH v6 03/16] media: imx219: Account for rate_factor in control steps Date: Wed, 1 Jul 2026 15:26:20 +0300 Message-ID: <20260701122634.1728782-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260607215356.842932-1-sakari.ailus@linux.intel.com> References: <20260607215356.842932-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The controls that are divided by the rate_factor before writing them to the registers have the step of the value of the rate_factor. Take this into account when the control's range is modified. The controls are created in a configuration where rate_factor is always 1, hence there's no need to change the code adding new controls. Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus --- drivers/media/i2c/imx219.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 05d9737bdc95..2aab6e7180d4 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -319,19 +319,19 @@ static const struct imx219_mode supported_modes[] = { /* 1080P 30fps cropped */ .width = 1920, .height = 1080, - .fll_def = 1763, + .fll_def = 1762, }, { /* 2x2 binned 60fps mode */ .width = 1640, .height = 1232, - .fll_def = 1707, + .fll_def = 1706, }, { /* 640x480 60fps mode */ .width = 640, .height = 480, - .fll_def = 1707, + .fll_def = 1706, }, }; @@ -458,8 +458,7 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) ret = __v4l2_ctrl_modify_range(imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def); if (ret) return ret; @@ -887,7 +886,8 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, /* Update limits and set FPS to default */ ret = __v4l2_ctrl_modify_range(imx219->vblank, IMX219_VBLANK_MIN, - IMX219_FLL_MAX - mode->height, 1, + IMX219_FLL_MAX - mode->height, + rate_factor, mode->fll_def - mode->height); if (ret) return ret; @@ -905,8 +905,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, ret = __v4l2_ctrl_modify_range(imx219->exposure, imx219->exposure->minimum, exposure_max, - imx219->exposure->step, - exposure_def); + rate_factor, exposure_def); if (ret) return ret; @@ -931,8 +930,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, return ret; /* Scale the pixel rate based on the mode specific factor */ - pixel_rate = imx219_get_pixel_rate(imx219) * - imx219_get_rate_factor(state); + pixel_rate = imx219_get_pixel_rate(imx219) * rate_factor; ret = __v4l2_ctrl_modify_range(imx219->pixel_rate, pixel_rate, pixel_rate, 1, pixel_rate); if (ret) -- 2.47.3