From patchwork Tue Apr 16 14:19:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13631956 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 5825112F58A; Tue, 16 Apr 2024 14:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277156; cv=none; b=ryKHgGRCrfIAmKP4EM7bdGcAM2dmcF7CWHAEa7ejxeJ6st0cWPmjl6vTfOpTTTrm20D+MvugT7elOtKnp/7yrjMcUSp3ytIRSlT8d8wTOlcinOWOiSoU3pwS44kqZS6PBVxBZ2FcGws4P0oZyMZJXIJ2wAw5oHdO9gHfEuTHLQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277156; c=relaxed/simple; bh=AeWQU4CLyP//rGZTX/6elqJTYpv8NEiN+bbJsGd8pOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ib5dcX2+pfAQgNC0G9dKFibGS6tM8Gm84pnw3LnduQgwvONoxcixdSk3m+YWaPqXQjGzerWsMsRhip1ZdJGfyfvzqGYQz+zMyejJGSQqxy90lQRosjI6VjS8zD27lmQPIytXHiFb5yf3gR0xLN0lsrT9zA9d7SDXtotGObyb2NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DwsvbAzw; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DwsvbAzw" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4185e80adfbso11910795e9.1; Tue, 16 Apr 2024 07:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277153; x=1713881953; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qO5E9FFaQmEHN0MN8J8zJ1rF9ABCmvsemgJuR18aoBU=; b=DwsvbAzwri3IjTCAcRIBbtvMM204d3yO6MNIv96zuik4crcJQkubqb8oynXDUpwoFR KAPoQzlIpcBbcqhy0vCSsrFFrCR4Gv4bJEoLdtkW3fvbI7aHeW9MMXNQBOSTLYGmwnPp jtHMpbTJH7EkL9px/UfUOuDSQMzYu+bPDCrbBLKNAT424hlVy1RLRGS/vE3Ip/mD0HiU K5u+3AIsUOEPQToXrQmUM6WOIzWYfFzrHcCnJI5jIWdlzzs7yKLdUfag6ZcFBDEHFXA5 VA9+IbYZ5pNI9nj0s7eAdwu53Q3hdbiNc8CnPqdFuMCqYAPr7MkAASNFvW1aLSGGsXlN qJvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277153; x=1713881953; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qO5E9FFaQmEHN0MN8J8zJ1rF9ABCmvsemgJuR18aoBU=; b=KqDlOxk3MN+jMWUwPC4pQDZBDmHv5xqyG01Dmjvxe1Bfb/EFADQ5KW+FPURq+dHkfi j4Qsu1Arbn8WoMpLoZrrMJNtzCj+XxF6JbBt+woVWtbcUCuFoxiKrG41N8DC5oeYlsWo b1lmNotm5LPbmH8BZfMsaOpgpU2JkqoSp8aDxZjDnO47ombhihPe28i+Wf22ZsVK9rdx oMO7ARsRxtL8mrHW03YSTYZ9pHK6JhOFoiwuFsr125IKcCTE5/T2zOAHwGTBGPWQs/ro e6cbtnOMqlnuqFqqEkjjNbONCFtmfkHywf+4l+htulmjc3ZXvsRP1G4F4ZUpbQM2CCVM UyOA== X-Forwarded-Encrypted: i=1; AJvYcCU0W0T+STneqDW5OArPDu5l41EuRo2YPZiUjzwFnhpA89EVGIJvH5116tqMHw3kHl63Vv3DP9A2WrK79YvoVPJbbtOy7Y737ITMmd6JsfEoEk1J28CZm6vcyfFwofBo1eX1ogthhti0hxE= X-Gm-Message-State: AOJu0YzKBqse81/tt26cUpsZ8Ni4AuKQB/ZhikmR3sWs63Y/K+48pqUc B9Nc/wgAW1Y3BbgVUYeWwm1j7snkJaEQJI0gFv+YbHQpX4HHjEtT X-Google-Smtp-Source: AGHT+IEv6yRW8mrcNmjWlWRPIOilkzMEDGER9GTMpOVn8B1Ym6bB4P1gDX0I5S3RGTxXr6jG+1oUpQ== X-Received: by 2002:a5d:5886:0:b0:343:ef64:e0fd with SMTP id n6-20020a5d5886000000b00343ef64e0fdmr10168721wrf.52.1713277153579; Tue, 16 Apr 2024 07:19:13 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b0034625392416sm15055114wrj.104.2024.04.16.07.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:19:13 -0700 (PDT) From: Tommaso Merciai To: Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu, tomm.merciai@gmail.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] media: i2c: alvium: fix alvium_get_fw_version() Date: Tue, 16 Apr 2024 16:19:01 +0200 Message-Id: <20240416141905.454253-2-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com> References: <20240416141905.454253-1-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of reading device_fw reg as multiple regs let's read the entire 64bit reg using one i2c read and store this info into alvium_fw_version union fixing the dev_info formatting output. Signed-off-by: Tommaso Merciai --- drivers/media/i2c/alvium-csi2.c | 20 ++++++++------------ drivers/media/i2c/alvium-csi2.h | 15 +++++++++++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index e65702e3f73e..991b3bcc8b80 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -403,21 +403,17 @@ static int alvium_get_bcrm_vers(struct alvium_dev *alvium) static int alvium_get_fw_version(struct alvium_dev *alvium) { struct device *dev = &alvium->i2c_client->dev; - u64 spec, maj, min, pat; + union alvium_fw_version v; int ret = 0; - ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_SPEC_VERSION_R, - &spec, &ret); - ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MAJOR_VERSION_R, - &maj, &ret); - ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MINOR_VERSION_R, - &min, &ret); - ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_PATCH_VERSION_R, - &pat, &ret); - if (ret) - return ret; + ret = alvium_read(alvium, REG_BCRM_DEVICE_FW, + &v.value, &ret); - dev_info(dev, "fw version: %llu.%llu.%llu.%llu\n", spec, maj, min, pat); + dev_info(dev, "fw version: %u.%u.%08x special: %u\n", + (u32)v.alvium_fw_ver.major, + (u32)v.alvium_fw_ver.minor, + v.alvium_fw_ver.patch, + (u32)v.alvium_fw_ver.special); return 0; } diff --git a/drivers/media/i2c/alvium-csi2.h b/drivers/media/i2c/alvium-csi2.h index 9463f8604fbc..9c4cfb35de8e 100644 --- a/drivers/media/i2c/alvium-csi2.h +++ b/drivers/media/i2c/alvium-csi2.h @@ -31,10 +31,7 @@ #define REG_BCRM_REG_ADDR_R CCI_REG16(0x0014) #define REG_BCRM_FEATURE_INQUIRY_R REG_BCRM_V4L2_64BIT(0x0008) -#define REG_BCRM_DEVICE_FW_SPEC_VERSION_R REG_BCRM_V4L2_8BIT(0x0010) -#define REG_BCRM_DEVICE_FW_MAJOR_VERSION_R REG_BCRM_V4L2_8BIT(0x0011) -#define REG_BCRM_DEVICE_FW_MINOR_VERSION_R REG_BCRM_V4L2_16BIT(0x0012) -#define REG_BCRM_DEVICE_FW_PATCH_VERSION_R REG_BCRM_V4L2_32BIT(0x0014) +#define REG_BCRM_DEVICE_FW REG_BCRM_V4L2_64BIT(0x0010) #define REG_BCRM_WRITE_HANDSHAKE_RW REG_BCRM_V4L2_8BIT(0x0018) /* Streaming Control Registers */ @@ -276,6 +273,16 @@ enum alvium_av_mipi_bit { ALVIUM_NUM_SUPP_MIPI_DATA_BIT }; +union alvium_fw_version { + struct { + u8 special; + u8 major; + u16 minor; + u32 patch; + } alvium_fw_ver; + u64 value; +}; + struct alvium_avail_feat { u64 rev_x:1; u64 rev_y:1; From patchwork Tue Apr 16 14:19:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13631957 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 55912130A57; Tue, 16 Apr 2024 14:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277158; cv=none; b=KuP2p3cfiiUNWYJc1U1OpsyqM1DojFNAKyO6n4qSGzZoi4nYbPZWhiWNZbVdhXTy6EEdkHoh5SEE/YPzs0a+8iVBJqcJU/E3tWZotpvxKnQm27ShvCUyid/m6c0j529mN7TqsB4olMRIaJ94DvCzfTKF7VbglfVAw1aijcPyVbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277158; c=relaxed/simple; bh=Nee0klNczzXXdVsbbxNrNAe9EZXbzlkhe7k0ay+DWp8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BlTbUwJdWFdvDTG8akF6ZAvOwDpKMPaMp5iR7z//HX+0Uv9UGlYizbg3b2vN0VOJ0ndEFfZ8Ne/mayUYV+5pcnS8bmQPSKkoDhSk8tBQhXZi72l8pzfdRkLQWy3J7MJ+8nQ3wzcdN1zwyCkT6eu49LVMyhNCFp6TvRmn+l0qfOw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wc+0ijUd; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wc+0ijUd" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-349545c3eb8so492753f8f.2; Tue, 16 Apr 2024 07:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277155; x=1713881955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PPlMwU0r21lmv701IrsAmWv+8jqBp9Lh4gdhKs5vLCQ=; b=Wc+0ijUdtKB6wKbUwYSNbw8GVMud0x1tzYxC0s9vgoxJ2LEhT6j4AtikKRcAnGjSDc SBvSI/T5/y65ci0bSMpLTPwJESXBOuwtvsLBCxEvosXH/K36LpZpjl2YAZwlkKuf9pSQ t7fn/ji8g36vSeJFT203k55sg9tKu19aCXMGJRYrV7x/yxA1225iXTGlM1dxD7Y1vp7q ogVKRudA0fOHK/J2eFXwrYx3FmHYIKCy0jenFGydO1clho3kHDMmX5MM8u61pTceLSLz js6mQCLOtvVv/PUihu+ZGVPPOJ0i5tSf0FDMpvZ6jZoYNBLhZkN++UnKkp0LkhwtjtSe Ahjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277155; x=1713881955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PPlMwU0r21lmv701IrsAmWv+8jqBp9Lh4gdhKs5vLCQ=; b=QyrxA3DkzoPt9Z4PkpSXcY7Rz6VAMx8RxolwRDn6XVkYYNeCILRA9F+3HrP3F9++HX z/Z9aTlN2TLI/8NrB/gj/ltsbot9/7mha0FMbGGknxCOjkMoq48/XNajCadmOoiLFQFZ k1Wb8FPvU9Mlbh8kAcVsNlKJR0QLo1acOBRApiF/yGZBKygiPfHkvyDq6RP8iGOBFzD0 4ghlQtGUgKPwKVi7NgOU8B6Abz7hJ8AFm/6s0VRzIlsuFYDnPkoI30d8Sy2tmYHKl6Ub pFmAYsuzibe0UETYkoYV/I+uHpk0l5rLNrDeHXKfv5rfMwzKY6ECIyXl84MWiF3gbBCh yt2w== X-Forwarded-Encrypted: i=1; AJvYcCUwG/23dEVjxEZ28BtjBsmmqaEHHuLtXq2JHSYhUzjiNw3KgmcP3fdCbEW5iPTPWwYpgjbVk9f3LX3QFMplaVO/wbjblTFVVnsdOKdiW5MLsHyu58wmScsSLobr1Srpka/nS/nb0UGjwiI= X-Gm-Message-State: AOJu0YyvmhqCmn0cH9PeKT0d3UQU9gftuIr2fGZFGZHQyzJQSWgVGK8c FhqcOiPR5WrJ3hQKyS7cPJi7RqwW3asS8w4CtLLFNLq2az7lODJL X-Google-Smtp-Source: AGHT+IEZzv00yF7BllXr8OH/cKVVc5yOZl4HVoOrPS3fQ9aYwHYUkg8sgoEe5/Vwr79iOaQO4aWt7Q== X-Received: by 2002:a05:6000:1cc8:b0:343:7896:209d with SMTP id bf8-20020a0560001cc800b003437896209dmr8900303wrb.22.1713277155479; Tue, 16 Apr 2024 07:19:15 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b0034625392416sm15055114wrj.104.2024.04.16.07.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:19:15 -0700 (PDT) From: Tommaso Merciai To: Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu, tomm.merciai@gmail.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] media: i2c: alvium: rename acquisition frame rate enable reg Date: Tue, 16 Apr 2024 16:19:02 +0200 Message-Id: <20240416141905.454253-3-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com> References: <20240416141905.454253-1-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Aquisition frame rate enable reg have a very long name let's reduce this with an abbreviation. Signed-off-by: Tommaso Merciai --- drivers/media/i2c/alvium-csi2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/alvium-csi2.h b/drivers/media/i2c/alvium-csi2.h index 9c4cfb35de8e..c1453ba885cf 100644 --- a/drivers/media/i2c/alvium-csi2.h +++ b/drivers/media/i2c/alvium-csi2.h @@ -63,7 +63,7 @@ #define REG_BCRM_ACQUISITION_FRAME_RATE_MIN_R REG_BCRM_V4L2_64BIT(0x0098) #define REG_BCRM_ACQUISITION_FRAME_RATE_MAX_R REG_BCRM_V4L2_64BIT(0x00a0) #define REG_BCRM_ACQUISITION_FRAME_RATE_INC_R REG_BCRM_V4L2_64BIT(0x00a8) -#define REG_BCRM_ACQUISITION_FRAME_RATE_ENABLE_RW REG_BCRM_V4L2_8BIT(0x00b0) +#define REG_BCRM_ACQUISITION_FRAME_RATE_EN_RW REG_BCRM_V4L2_8BIT(0x00b0) #define REG_BCRM_FRAME_START_TRIGGER_MODE_RW REG_BCRM_V4L2_8BIT(0x00b4) #define REG_BCRM_FRAME_START_TRIGGER_SOURCE_RW REG_BCRM_V4L2_8BIT(0x00b8) From patchwork Tue Apr 16 14:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13631958 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 48285130AEC; Tue, 16 Apr 2024 14:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277160; cv=none; b=jcRzxx96lWeudZ0206tUn9dQAoG/6pplof2iSNqiVj6ziIWFf8AQ5V0XEdPyvwH8aCy1DbnpCXPVB23AZ5aEHE1JFoDhH4gT7BBTRbjkvM48czg3glIQxlXsU07+20K0aTUAvzvk6auvqJSh/yZSfFN+rTax3hugeYs8dc5xWqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277160; c=relaxed/simple; bh=kOk94sDfRB9obNeWEXtFIH86DpFIYOJJKzMDvNPsJSI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pd7tM4CCcQC9vR8Ya2JxNaLnCiJHrZ38oq4ZojVILjIOKy4AJu+oMJ1BlWRbB8wCSAkiedl91KhcYdgBL+rD2doyOTCEdpziLBUkqc6wZkiSEgsMiuEId67IfZp3kgE8H7lMVDunzZUXNc5uDWjy5+x41v48sUQUgI+8E1XiPaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wx9+IeLn; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wx9+IeLn" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-343c7fae6e4so3683515f8f.1; Tue, 16 Apr 2024 07:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277158; x=1713881958; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jYnzlWewa0I9IkBCguztRigCuk90aXorNy3BFwvN0fM=; b=Wx9+IeLnkxSqWJeUcsrarhyU4Dh/9iVboMpJ72pIYmIaZOBYpVjcmuEaDhFB0o3nD5 4Y6e7OPBAHaNdZveCZDHGh/lP+6P0Y1eNnzegU0MQGoRrgw72v9rNA2Cx0ZtX/5pEv3k 3D87W+8/DxCr4ZBbjPve17ic0m/TQu0FuJaocO8lYbdYTNw+1rS1/GaMBjZlrHapJKcF 4v6bcnIGe1muFQ7s9eQ0MU+G9/uwUyP4Q7uAzF8Haz18gcK02YGFMgOC/a32dLQEgYkq 066zbdYVyGLJ4jWftCmdVX1SZOgC3LPTTsRM7JjaNG0CuOaoIM67exfZBHiuyTCIX4kv ISvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277158; x=1713881958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jYnzlWewa0I9IkBCguztRigCuk90aXorNy3BFwvN0fM=; b=oYsjFkmWkaLyylaOe/qQz/9uUg1IQcKdLQQrO1VVBU0hM1WRv6BdaCyiIBUyMRLWB1 GbK/WJ38OBXXBqn2hWtxvm5Q6ZFTklF1s5k69Yn80hR5euCQy4g3xlHs8asiDZlJrh0s 5X7Nf4BRRswuvU/kePhC7bxaGhBUlrcZEUoF58eXBtrqmJpbS9fTnN1OmdcNrRX+4AWx FmaVK5zIiPYJ3oqmufsdUk2l/z3vV+5UdGLYu5SAhHzuCCNxOqkFJiquwSrnUCL1DgWD AFUmU9zdJrbY4NCq3PAgiXBSJXx8T2I2aR0rD1HciHxhtF5vYfXhyVKo1oo7UaBBB6ve zGFQ== X-Forwarded-Encrypted: i=1; AJvYcCViOGiG8HMyXAIOTGLramDKKpM2XRqJjKZmDh2LcRrXjW5MawW1nswIenDKC67i6DROKMddXHmCxFU6ztj6Ch2pkJioi8RZJFHV2NX7jDwTpTV1Y/tpGXpkL4lDWRtYFdf45aZXaMKiE9g= X-Gm-Message-State: AOJu0Yy2re+quYixwKaAwa0qEB11z7u/FFw7iFSeugrexnMBTIlr1Pj5 kJrwwzV7q3W4clNd9WiFW29CJC9oDSafY7DRNPCV9AINtae8QJUf X-Google-Smtp-Source: AGHT+IEljBxtTyx0rtlKruqwcJPIJgMekDTR3xsVmj4xQPNJoh/Wke5o53Ls9bSMXgpwNruF+wzgHA== X-Received: by 2002:a5d:59ae:0:b0:343:ef33:3ba5 with SMTP id p14-20020a5d59ae000000b00343ef333ba5mr10139620wrr.3.1713277157488; Tue, 16 Apr 2024 07:19:17 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b0034625392416sm15055114wrj.104.2024.04.16.07.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:19:16 -0700 (PDT) From: Tommaso Merciai To: Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu, tomm.merciai@gmail.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] media: i2c: alvium: enable acquisition frame rate Date: Tue, 16 Apr 2024 16:19:03 +0200 Message-Id: <20240416141905.454253-4-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com> References: <20240416141905.454253-1-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Alvium camera by default is in free running mode. Datasheet say that acquisition frame rate reg can only be used if frame start trigger mode is set to off. Enable r/w aquisition frame rate and turn off trigger mode. Signed-off-by: Tommaso Merciai --- drivers/media/i2c/alvium-csi2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index 991b3bcc8b80..2ab4c7e563d2 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1184,6 +1184,20 @@ static int alvium_set_frame_rate(struct alvium_dev *alvium, u64 fr) struct device *dev = &alvium->i2c_client->dev; int ret; + ret = alvium_write_hshake(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_EN_RW, + 1); + if (ret) { + dev_err(dev, "Fail to set acquisition frame rate enable reg\n"); + return ret; + } + + ret = alvium_write_hshake(alvium, REG_BCRM_FRAME_START_TRIGGER_MODE_RW, + 0); + if (ret) { + dev_err(dev, "Fail to set frame start trigger mode reg\n"); + return ret; + } + ret = alvium_write_hshake(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_RW, fr); if (ret) { From patchwork Tue Apr 16 14:19:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13631959 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 18C61131197; Tue, 16 Apr 2024 14:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277162; cv=none; b=PxXiMKS1t11l2gqkw5wE6kE39Poa3oV6JgEpoyc7sRM21m8jCiE+QeWaQHD6u9CrSLz83MXIZlA8Tn5n0vLHKwnN2f52+P2DATN2doWA6W0iOnQMf+g56wKKhIaCh+gZqXT8l0r5k97AYgBX3Fi7HFJWClB7lNtPZx+exEOLH0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277162; c=relaxed/simple; bh=VD7sF7wNf6E8hter+2Fpq1VzyDvV4t+EIagEUr9qBVU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qji1H0KDSarCQDeeNrzEfHJ1q1rDOpqtOYDDMDdPrEKaXWJfd/B2kLh7/2W8mw1cftDnGIxHYWNQMnl3Lp4+u3txE41t39tNOoINrAXiTJTPfiO4FynH+ZzevPNhRyi7vnoFC3YsdpgPPuh6xTkuVrLkcBG3lOgcWfJME/68BNE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DjpoSWjI; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DjpoSWjI" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3465921600dso3975524f8f.3; Tue, 16 Apr 2024 07:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277159; x=1713881959; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jplUX2Z22IzViGFKKT1zerZd+0Nbd9om17H2hhvI1qU=; b=DjpoSWjIeNOlCcWfXyApEj2SN7qXZUVP8PmX0y4ZzN2ZUFZ240sH9OECeVE4w8HsEo DRvYGVHsaygk+2iVQ2ChCKqUMxR91yPCPcRkR8HGXYoh9xea+GQtvhK2KKCqLZJrbh5R 8C1w8Uv4NN/HMbW6F96Np+XsYxUqozdjPW0ROh3wCD0tGMF9Weud+qR3y3M3AJPOPWCn R8l6oKYO9fJEyKT82Pg5BHpal2vS1oP9nyfSH88Bq7w6l8IYsicadKJrzABKkwk3nU/N izmQLm0p4eyn36rY+iEHX5oZmD9NMWhGk0WNZbrb+j5w+zUk2q/BUzsKKiIe6IeUpXR4 TRPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277159; x=1713881959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jplUX2Z22IzViGFKKT1zerZd+0Nbd9om17H2hhvI1qU=; b=sfT2sXMbRJHR4DOvjdS3gqdVo/jk373srSAbcC0G2Wo1n66NkGQFxTz1GuOVDqMYGg oIce8GAXCGsEKED/Y2YgeHYkC//19XNY7HslUUOsvDnslHxztnVYfbeujwFSaj8C3TUr P028NRTNmW1/xKlqWbftYvtyJ//N+eC+5G9yGkohORzt3GZSXKCOwid1wL/CHUQNN3Mf QnsBcg9nVxYwFhL6TPR/FK2nYYmftK0PycHbtvdHJve9kJXR3NWjJbvlPew5/CXfvVop nCJ82UixbohH4AWuT8pW+rAfa3IvP+iD2sySLZJOaZeEpcdxW2GTwmpDnc8x2Kt7KIU1 8bzQ== X-Forwarded-Encrypted: i=1; AJvYcCWi4Nviu0F5hMTBXJkLkoZa7eyaQp62q7OQyLpTu0JFfGJEI04/lWTqbWFLHL0Ks95ietfWV2fFgZfO9DFXODWk43MCWSlzKbMsYdjgDM5buiMhRqEvLBfw4qzp8U8JLag/1nex8YiuMUU= X-Gm-Message-State: AOJu0YwO57G7vhTWswE3YF38Dk01tUkS4r1ZaoXsH4frFjBDxL8kh37X oMzp18B+kX4B8Zv2OWn09c45JaCJhYIV+tJiRpl335QwFp1zcMGO X-Google-Smtp-Source: AGHT+IFix+57hY89L4+mjqA0Cz3qrEdkRBWQepHFIfBHt+YatMHq0HeYk2ornFqRaHEJSwZGgrR/MA== X-Received: by 2002:a5d:4411:0:b0:349:8a92:7eda with SMTP id z17-20020a5d4411000000b003498a927edamr968333wrq.12.1713277159450; Tue, 16 Apr 2024 07:19:19 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b0034625392416sm15055114wrj.104.2024.04.16.07.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:19:19 -0700 (PDT) From: Tommaso Merciai To: Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu, tomm.merciai@gmail.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] media: i2c: alvium: implement enum_frame_size Date: Tue, 16 Apr 2024 16:19:04 +0200 Message-Id: <20240416141905.454253-5-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com> References: <20240416141905.454253-1-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Implement the enum_frame_size pad operation. The sensor supports a continuous size range of resolutions. Signed-off-by: Tommaso Merciai --- drivers/media/i2c/alvium-csi2.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index 2ab4c7e563d2..30ef9b905211 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1717,6 +1717,27 @@ alvium_code_to_pixfmt(struct alvium_dev *alvium, u32 code) return &alvium->alvium_csi2_fmt[0]; } +static int alvium_enum_frame_size(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state, + struct v4l2_subdev_frame_size_enum *fse) +{ + struct alvium_dev *alvium = sd_to_alvium(sd); + const struct alvium_pixfmt *alvium_csi2_fmt; + + if (fse->index) + return -EINVAL; + + alvium_csi2_fmt = alvium_code_to_pixfmt(alvium, fse->code); + if (fse->code != alvium_csi2_fmt->code) + return -EINVAL; + + fse->min_width = alvium->img_min_width; + fse->max_width = alvium->img_max_width; + fse->min_height = alvium->img_min_height; + fse->max_height = alvium->img_max_height; + return 0; +} + static int alvium_set_mode(struct alvium_dev *alvium, struct v4l2_subdev_state *state) { @@ -2224,6 +2245,7 @@ static const struct v4l2_subdev_video_ops alvium_video_ops = { static const struct v4l2_subdev_pad_ops alvium_pad_ops = { .enum_mbus_code = alvium_enum_mbus_code, + .enum_frame_size = alvium_enum_frame_size, .get_fmt = v4l2_subdev_get_fmt, .set_fmt = alvium_set_fmt, .get_selection = alvium_get_selection, From patchwork Tue Apr 16 14:19:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13631960 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 63951131E41; Tue, 16 Apr 2024 14:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277164; cv=none; b=IO+ZF1zmZjP0HO2xdzwlPeUkblYM6uOkPpCXXXpwhNDhbljmUAAlQyM2STUg90lLO1U6psVlCwihCrhGtVs7ZEsATm9hYEqc8NJ0atUerKiA67xJ06twSTRg1Jx+xOFPYWEPCbifo5Pgc8mid9aBW1eZOUn/ix7L4oYMYIass20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713277164; c=relaxed/simple; bh=aq0hA7B0x5d706qgYJ1t7a6tNJ/tdhFYP2EzIgnL85g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZK8B2S5YlW69JTcfA1JfbAJCS10f2yWTjF2rJ3WW9L4LDHmDO6cKYEXvevcTH9meD/2gSeDRr7lM1SuoKSCkhWjqA17nLU4OvSAqYZz3bycWvG6oj/qF9IAjMXE6Trubu45nE5pGX498GEzH7Jhm09ELFNP8edm/t9Bqi3wgcX0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nE8rRiqc; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nE8rRiqc" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-518931f8d23so3487570e87.3; Tue, 16 Apr 2024 07:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277161; x=1713881961; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0GMJKaoKwWKNVSrwIZ9iKLJO15TvA/nZDanwLNQOYh8=; b=nE8rRiqc7I+q/npdJ0/6j0j+devTGf9eSrsDT0pWu60EbdQtcaJc6Js5v2frJOoX2V FJXsZmsS7/+cecpaCn5BOglwYRKE7t7XCfqxSdqlUmcNfyUtSDzM5X5syjTNq+oEqAA4 FJR+BxO4vnlMzVAR0oMOa9v0Ota4t3sG/l7dvz3itxYt4UeQf5I3l22zfglq4ttSxnqE etEj11DsZq1pkWAccZik1kArpdW7AwxeWwHV2yECVkLrnxH2EwcHickJfPpLq2YOZams d2BRVc7G/kK1sZ9ekbjnGB4gh3wvVc1ptaDTeW/cgaH5Xf5pvVBFQhlWj/Hj8SyUQ37o FqNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277161; x=1713881961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0GMJKaoKwWKNVSrwIZ9iKLJO15TvA/nZDanwLNQOYh8=; b=kP0xFJiox2bMvFXNAOH7kphHle/TfZZAtutV2apQr8N4dgTiz+SHJBvWU5ztbrVQJx EpJEfSEdCMICnMWEpToDLm+2+1aN0tvdKpO5Xcj6SXxVGm5J1gOURBRKria06tcK6pDb qWoZiqH5qAXzj9uHMx5oZYJ0XyPROb4ughesGTO5wMG9s67C53vBJjEfx1d4yz/iSDet PbejUROn+Jo0FTLJae0r2Fe8zUMZemMhuE/sVhh6mLzla0gc3u7IE3uK3mrO2ZweJFWL +ijYBWzBpX96lNmiARjnHr1H7i7L/tNwQO7SOWUOZF7k/2zdcQn3SJWRFUbwQ4TU8uIg DPhQ== X-Forwarded-Encrypted: i=1; AJvYcCXlhDS2U/nfGVMintYh4SSO2SUp7H4rJiPqJveY+Zt/4HWiy4wk3BQIStbuWE2+wC1gl/6oj62Hw6+OJBAnicA/tqXDrV+cRMSB8PJ2SqIzzp7mguy1IhmEwUCxSQl15LsuSipCNy++KY4= X-Gm-Message-State: AOJu0YwfzoeHxgvzZ+l07XcduTHG3+n3Dp72HUy2ugb2jIYWMfMwW0L0 BDRvPd9aRsNYyZD6aMjpAiOt9lXz8aliNIqWEMCJo4zy6XKkCN/H X-Google-Smtp-Source: AGHT+IHBJ0Nzhvg9pviwXNYSE4vtYuBxCtJRz2rlBKHTpH2keTuRXZuNdEJjborrQSYEGwDaBlmXwQ== X-Received: by 2002:a05:6512:39c5:b0:518:de06:31b6 with SMTP id k5-20020a05651239c500b00518de0631b6mr5329251lfu.3.1713277161120; Tue, 16 Apr 2024 07:19:21 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id b11-20020adfe30b000000b0034625392416sm15055114wrj.104.2024.04.16.07.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:19:20 -0700 (PDT) From: Tommaso Merciai To: Cc: martin.hecht@avnet.eu, michael.roeder@avnet.eu, tomm.merciai@gmail.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] media: i2c: alvium: Move V4L2_CID_GAIN to V4L2_CID_ANALOG_GAIN Date: Tue, 16 Apr 2024 16:19:05 +0200 Message-Id: <20240416141905.454253-6-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416141905.454253-1-tomm.merciai@gmail.com> References: <20240416141905.454253-1-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Into alvium cameras REG_BCRM_GAIN_RW control the analog gain. Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl. Signed-off-by: Tommaso Merciai --- drivers/media/i2c/alvium-csi2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index 30ef9b905211..56d64f27df72 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1993,7 +1993,7 @@ static int alvium_g_volatile_ctrl(struct v4l2_ctrl *ctrl) int val; switch (ctrl->id) { - case V4L2_CID_GAIN: + case V4L2_CID_ANALOGUE_GAIN: val = alvium_get_gain(alvium); if (val < 0) return val; @@ -2025,7 +2025,7 @@ static int alvium_s_ctrl(struct v4l2_ctrl *ctrl) return 0; switch (ctrl->id) { - case V4L2_CID_GAIN: + case V4L2_CID_ANALOGUE_GAIN: ret = alvium_set_ctrl_gain(alvium, ctrl->val); break; case V4L2_CID_AUTOGAIN: @@ -2154,7 +2154,7 @@ static int alvium_ctrl_init(struct alvium_dev *alvium) if (alvium->avail_ft.gain) { ctrls->gain = v4l2_ctrl_new_std(hdl, ops, - V4L2_CID_GAIN, + V4L2_CID_ANALOGUE_GAIN, alvium->min_gain, alvium->max_gain, alvium->inc_gain,