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: 789630 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: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: 789629 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: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: 789628 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,