From patchwork Mon Jun 10 08:10:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13691643 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 27E24745F4; Mon, 10 Jun 2024 08:10:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007044; cv=none; b=TPG7TKg/oKiyGG2CGbexKPZ8ZYMyC4PDzziXUGSxWE7pLbweQUoMrtgwhlPZkAMiALLhoEK5ZITT1NoXCz9KHxqoEbYqcT7WXWgrqSjbdZu6M/0bVfjj89qR5Umev0HrtxuKODFKbB/xJw7dzl0SaKCBb1/x/O0VL3oOi18kgHI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007044; c=relaxed/simple; bh=lsZZm429aZ80AiEqNfmz436mxdxk7GVMSTRxDA+I7K0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OdHfgsndnFFkqSzHURlsUEGv0KgSMPkZDTgv47TK+rX+iTJHBxh68bVCHjix7lZIGGDB8RGOoDTdADFPYpOa/5F96Z1LI3IhAbYBLmklcBu2g9ZzEv37XLR+lixuSF7V3lZfCmfIFjZmyb0qM0oGPsbL9ct6DJALi1H6ADc/7ug= 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=RwkcKzBG; arc=none smtp.client-ip=209.85.208.171 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="RwkcKzBG" Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2eaea28868dso31516141fa.3; Mon, 10 Jun 2024 01:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718007040; x=1718611840; 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=z/tvOrV3lDKGVpK4tR+NNQNmVg8LHNueBnoz36Fe83g=; b=RwkcKzBGDm0qaGqL5sQwluufV79UIjw0FD4lKtZB2RujVusQsGdbx5Umh3qBLa4WnE TaVdIHxEl5icAWEMwxF4BpuKJAITZn3ueA/SLBmQ968UCzsyNIgqcuLjtrVhomjuSZw0 r6NNcC6ZLQ2fc4zBkp1vkGtPGyrxuyPxm8Wy6EeGqXd0bT2ZElBBWbBK1aw10z735Are HT1Ji3KGWpeOvXzaxhFBxNnC1d8mPv5h4mWq2ulp4g3hSHYqYEaHgyH6kxUylNRTNj1S aaTC+TEhiyyLgfJkgk+pNFN3zR8y+iIqZKmygXco5sit/cIFHkeZSYeMadwFwmu9dA0L mpNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718007040; x=1718611840; 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=z/tvOrV3lDKGVpK4tR+NNQNmVg8LHNueBnoz36Fe83g=; b=bx5AeJCNQ2dt930fwTjY27eQC7dVHast59ad8+rJPu9ulpee1ATCaA3kBfwqiVlqrO vyILbCcOpOg2cGbMAXivneeEeraXqSu21Otcx9MusYU+BqzEPFUbsxxm+kt7JUBmi52S ZdhKY0dCnM8QccYYnk4VqvYoKvMPdeVv7EJhANy/I6mX99aVtnxzq+XGlkasqtu1V0+R 3dKk+wQjX0kg+c8E4o5v238sMNKS2dLsaDKy2UN6InvjpMHRrKRfyr29bAS2ZteNbOft fVPOXQzqsBT6MljchsyULrOfariBcAXteIY9As3/d6ei0bTaUZkrYwPc6e4K5EYAmy3/ eKBw== X-Forwarded-Encrypted: i=1; AJvYcCUt+OAGbDYe00fC7Q6UEdny1UwD3glH0WaV7yIIdLXWGqbLjFXnTysvDX2uiHU0HH2NNSBJgV2hFfv17Yr9NiTNu2/rpFpXVC/H2y9u68NdrB40BXpUbqNsJ28/kvuZIao+uRgQrl9L6hg= X-Gm-Message-State: AOJu0YyG16OHw0A4L3xmcgbovBUWqAYpaBxJdUj33I5Pvb6lLEVz3tl6 XJ14CH2YuaYYKKdBnoZ1ENpOp/dW6PEAc6hSiPnry7pDZL6qqmUw X-Google-Smtp-Source: AGHT+IFincPHEtbCK4EgkjaE9BvOPw8+tj6N9/avwuekFyf4Q0WOluQpd1m6wcO7fP4eH2awGMxxRQ== X-Received: by 2002:a2e:9b0c:0:b0:2ea:ebb0:b5ef with SMTP id 38308e7fff4ca-2eaebb0b884mr50685401fa.19.1718007040092; Mon, 10 Jun 2024 01:10:40 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-58-5.cust.vodafonedsl.it. [188.217.58.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm18021315e9.35.2024.06.10.01.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:10:39 -0700 (PDT) From: Tommaso Merciai To: Cc: linuxfancy@googlegroups.com, sakari.ailus@linux.intel.com, martin.hecht@avnet.eu, tomm.merciai@gmail.com, michael.roeder@avnet.eu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] media: i2c: alvium: fix alvium_get_fw_version() Date: Mon, 10 Jun 2024 10:10:30 +0200 Message-Id: <20240610081034.1195523-2-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610081034.1195523-1-tomm.merciai@gmail.com> References: <20240610081034.1195523-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 use bit masks and bit shifts to get fw info. Signed-off-by: Tommaso Merciai --- Changes since v1: - Use bit masks and bit shifts instead of struct as suggested by SAilus drivers/media/i2c/alvium-csi2.c | 23 ++++++++++++----------- drivers/media/i2c/alvium-csi2.h | 14 ++++++++++---- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c index e65702e3f73e..7a38c424ea48 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -403,21 +403,22 @@ 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; - int ret = 0; + u64 val; + int ret; - 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); + ret = alvium_read(alvium, REG_BCRM_DEVICE_FW, &val, NULL); if (ret) return ret; - dev_info(dev, "fw version: %llu.%llu.%llu.%llu\n", spec, maj, min, pat); + dev_info(dev, "fw version: %02u.%02u.%04u.%08x\n", + (u8)((val & BCRM_DEVICE_FW_SPEC_MASK) >> + BCRM_DEVICE_FW_SPEC_SHIFT), + (u8)((val & BCRM_DEVICE_FW_MAJOR_MASK) >> + BCRM_DEVICE_FW_MAJOR_SHIFT), + (u16)((val & BCRM_DEVICE_FW_MINOR_MASK) >> + BCRM_DEVICE_FW_MINOR_SHIFT), + (u32)((val & BCRM_DEVICE_FW_PATCH_MASK) >> + BCRM_DEVICE_FW_PATCH_SHIFT)); return 0; } diff --git a/drivers/media/i2c/alvium-csi2.h b/drivers/media/i2c/alvium-csi2.h index 9463f8604fbc..ed712ad44899 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 */ @@ -205,6 +202,15 @@ #define ALVIUM_LP2HS_DELAY_MS 100 +#define BCRM_DEVICE_FW_MAJOR_MASK GENMASK_ULL(15, 8) +#define BCRM_DEVICE_FW_MAJOR_SHIFT 8 +#define BCRM_DEVICE_FW_MINOR_MASK GENMASK_ULL(31, 16) +#define BCRM_DEVICE_FW_MINOR_SHIFT 16 +#define BCRM_DEVICE_FW_PATCH_MASK GENMASK_ULL(63, 32) +#define BCRM_DEVICE_FW_PATCH_SHIFT 32 +#define BCRM_DEVICE_FW_SPEC_MASK GENMASK_ULL(7, 0) +#define BCRM_DEVICE_FW_SPEC_SHIFT 0 + enum alvium_bcrm_mode { ALVIUM_BCM_MODE, ALVIUM_GENCP_MODE, From patchwork Mon Jun 10 08:10:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13691644 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 9D163762CD; Mon, 10 Jun 2024 08:10:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007045; cv=none; b=rUrv8x73qn+HAA/TzUZgPOKTUf+qG8DZlbkcKsuNEdDmzYc7375KDcXlLncECHXW1TJ3WK4SAowJ+Qglh4ikJHoOlxqs+ES7NXv7Nw/UWNIPv65irye6RKmc6XqbDME43LlGKAhcOyv3DNmAeAf03b5H5hH7Pmx7rRRLZHgViAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007045; c=relaxed/simple; bh=UOMEKD+/rXv06IzA8JzvuiR+fcWZSD0LAA1sKQ13LYI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d8jpZgMmZlCJL7wOXnaxi97+MG93xb8cYJ/ZOq3+EM06uUcwdkBWTZkI1oVGhX67+1EmNUzPi7JXoYQRGevJMung+rU+54uUVEXDWsNmyEhq/OW6vPoGSW3BxVoQFnLm5NKimcYma0d5Q5mvSzbpBIezw2+2BnQ7g0VTgurGvg8= 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=Dg7yR/D8; arc=none smtp.client-ip=209.85.128.45 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="Dg7yR/D8" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42172ed3597so14576715e9.0; Mon, 10 Jun 2024 01:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718007042; x=1718611842; 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=i3rRW6PLOdb5jutY0sw45veXa+Cwa7eQVOOlVuiRgRE=; b=Dg7yR/D8+QfHUCBh8lcmLoOBgn8oufcZsXwT8P9h2L8SuurWQdoV2IyO0Y0CAzwk6W 8AGidrMU8n2tsGc5nZQXeKIZ8ZbFDvNZWN8GbY6rFHVSzAE/r4JC3ZNvxUGBlaLoXCtW E1DaHpM5Efa3hNtG7QyXjM7vtD5MKGPKTw4hky88nqWhaFLadJYkncfMN9eJAxV/XJM2 uYH0ACFGsqzqGUEkifPY2rRdRt/r1O1LqX6MLGUtANaVlannkEDIxbRji5mryAtSawRA 1WHb/s0qJRlrWbmpmKq4+zI9ekyPwJCX8/5jCRLBQ30dGqesqUlqw1o1PHcBuEnaFrWC vsxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718007042; x=1718611842; 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=i3rRW6PLOdb5jutY0sw45veXa+Cwa7eQVOOlVuiRgRE=; b=t4ApxhrLM/QjCBSutJ3wMd1RHJ6muIwE6nIx4lVstBgZz5czIkDFmdjbIuyQ8fGfpZ 3xRNb+jBbsEV4g0FBCVz17GZx7WKyCOsoJGLhCM3xVFCEcjzykOkIIJHskfyLVlYYoLa PLUeCB00wLvUCQRdet2Hsnaa4HBt78Ddhm1q8b/6TnTPFTFRU4AMOKv36T7cMrccywN4 hDBomvRSwIF/r7XCNbYVI7e48mnqpL85UnoI4/CDJJvu8rMcLvL/KV5UstRMA8jS1+Rq TZSPe3W5UTWw9pXku5WTcQ1rKLfGo79MaiY7aqKIZECEWO1KufmlGm6mZDkxdycQuWDb eVFA== X-Forwarded-Encrypted: i=1; AJvYcCUiRPfdkTHv++rQLkyZwrLNga1FBFYFS186/X3ky0Hst+n0BeEtrsNtmUKpJTNEo/emH+sRROpMmNxXeb2bmQrPa/oyny1opbMxWIHQ+1Fd3qPgpV7rO9RYVwRCZllQJZ5t3cw/5M4keMw= X-Gm-Message-State: AOJu0YwbRuTIfHiA8pkyCxBR9eWlk8oSMACMoofB0/OtnPW5glmGHUVG H/lpOqOQO+X5mq76ldr5XRjDMFX7/OVvdDJGgAZkjyznabrbUjTO X-Google-Smtp-Source: AGHT+IH46Udk2mJ+VtuXY5m+KV0PPkYqL1Il62EA1ZVniFiyeqncvc/q2NF4vPNaW32+43lJekzO+A== X-Received: by 2002:a05:600c:1d28:b0:421:811b:b83e with SMTP id 5b1f17b1804b1-421811bba6bmr33341635e9.13.1718007041867; Mon, 10 Jun 2024 01:10:41 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-58-5.cust.vodafonedsl.it. [188.217.58.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm18021315e9.35.2024.06.10.01.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:10:41 -0700 (PDT) From: Tommaso Merciai To: Cc: linuxfancy@googlegroups.com, sakari.ailus@linux.intel.com, martin.hecht@avnet.eu, tomm.merciai@gmail.com, michael.roeder@avnet.eu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] media: i2c: alvium: rename acquisition frame rate enable reg Date: Mon, 10 Jun 2024 10:10:31 +0200 Message-Id: <20240610081034.1195523-3-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610081034.1195523-1-tomm.merciai@gmail.com> References: <20240610081034.1195523-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 ed712ad44899..978af44f76c7 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 Mon Jun 10 08:10:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13691645 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 4DD4E7711E; Mon, 10 Jun 2024 08:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007046; cv=none; b=QvpMUopmKY0eNPXQqot3DynP2CSPu1mQQideC6bpiER/lT7LTMWIo8kQb839cjC6lSaaBSlvdc18l3JIxXi1zsBuSgsENPlVLWTiZGyzp7CP8zPRCoMPrpRgJYB+du7A342jwr11BSWbnG6NiCCvUkeF1L64qdtk9OGDeAMiFYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007046; c=relaxed/simple; bh=c2977yba0TG6X96B71/Clg3bcOXbpkBblsYZNCGLaKs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a5mE7SViH+ZN48++FnFcq5We/x34iwa1bJkfP/fHGG1LukT3ptNDdYfKpra0eqPKYyEE0v0Ay+vH0IgKayBZaI0n/HBuPE9UcIx5Se0BDJEJZtzLIrcUFmjtek+y+paGtxnmjyB0YDO7w+mUj+Xr8Gt1Xxzm3vdlqByKDjLeP9k= 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=ZpuNgKS2; arc=none smtp.client-ip=209.85.128.41 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="ZpuNgKS2" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42178999284so15499495e9.0; Mon, 10 Jun 2024 01:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718007044; x=1718611844; 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=tlv9ZYXfNn+mQvOemwskGWbmtcaerN5i2uX0MFOZBs0=; b=ZpuNgKS2n4lXEynoY7hQvB6VAi2Q1C3B7K3OkIm1B46W1K4m/QuOPebCSDgpYEgmpG gSmTXVztjYJUt0k2U+I07fqFu6XFy3W3qDPsDQDh4n/9XLyIlz62Y2YE0WlHg7SJyOzl PT5CwbyoPFSR6RFM+dqiFH6vb2MAbM6nB0SRSvuryHGAVXi4L+1cPkduM9/3+OaGl9K+ jOBj1Y3+gGaZPwhv7a9eTuBKdlz/lX1qRIsi4vRadRMGcgsL8NZpmCh3qdnrlRCWjQLx cojtybshmZGxk1ii76uV55mzYjNCesoqemRb2KJs7k36rP+LPNLifOkwHWuvbRzHwQte gdWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718007044; x=1718611844; 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=tlv9ZYXfNn+mQvOemwskGWbmtcaerN5i2uX0MFOZBs0=; b=sPXjRVOfExHF+Zq/8mUApdSfSNCZvWqgaqXK5ihtHHYGam3Ic+Cf4rjaOTU+jEn9r1 21I8/saoBuSfzjr5sZMldjDLmfFlm5rlMnCb/cWRl1n/I8Tnk1qMa0iDpd79PZqEggPg MSRe14sCwcpxw+3Pktq/xAdib2Hgdd6Klf0KEq1HUr0mcKoP7f9usEC64F6mhHQDXEQk Mpfyiq4y298XOF1l4lL2dVEl6Y3ks+Xs4ThdMWDDj8sIp/YzvmAXPvfaKfoR3u4maqd0 mDE/oLy2wMOJrTtan/Fo7CvC0hb4mj3hbVsAD8mLopWTZeKvxHnZULrkhMrAxW0EhagG IMFQ== X-Forwarded-Encrypted: i=1; AJvYcCUHMkwLNAE2LNNXNKOJgm8I1QvjOt5kZq6wZUE6+7sgASLpNPcv9/BH6NVcNkBXO4breOJAwOPQdk7y7rsxcqlkdWtQj0rGASAYheW1c9IRJ+1X1Vdp2ytWBFtj3Wd7LWopXiYmoOi/DcE= X-Gm-Message-State: AOJu0Ywhre2ZHaNND+atXxehGcR7/MBtLv1k3/zPc+sclmyxFTxGvn6U cEQuL8crEDXS8qizj7tjBmJrMx2+3HA1/sq1eQe8VIj+SsfL8b+L X-Google-Smtp-Source: AGHT+IGRCu4k6uCwzHvbUv838CJMTmaigO0So6zzsejGPi4lIkiC0mFwlB/NAHQnfvbcMHdfk+lfrw== X-Received: by 2002:a05:600c:1c10:b0:41c:2313:da92 with SMTP id 5b1f17b1804b1-421649ec7b1mr72604725e9.4.1718007043637; Mon, 10 Jun 2024 01:10:43 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-58-5.cust.vodafonedsl.it. [188.217.58.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm18021315e9.35.2024.06.10.01.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:10:43 -0700 (PDT) From: Tommaso Merciai To: Cc: linuxfancy@googlegroups.com, sakari.ailus@linux.intel.com, martin.hecht@avnet.eu, tomm.merciai@gmail.com, michael.roeder@avnet.eu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] media: i2c: alvium: enable acquisition frame rate Date: Mon, 10 Jun 2024 10:10:32 +0200 Message-Id: <20240610081034.1195523-4-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610081034.1195523-1-tomm.merciai@gmail.com> References: <20240610081034.1195523-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 7a38c424ea48..a88809333e56 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1189,6 +1189,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 Mon Jun 10 08:10:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13691646 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.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 42DB479DD4; Mon, 10 Jun 2024 08:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007048; cv=none; b=GtE/kTsU773w4hRzmMmiZ4Ax3KBbOKkaFRxOZvOQYH3oJn4C2OdOteK2ZzB6H1wNdsRidwcUU7Li7i6oEvge8LIkzCFGhtAmiIlEE4AsYFOCZWGANKaSSh7ZdurkPMvERCNr83Vg+wiCpCYujfP/GiR7HmdqD2uSx7NWN5jAur4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007048; c=relaxed/simple; bh=LLYiOPLlZ7zdUiO1gClkVKtBj30yeqQlUS51dzxFaR0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QxvIhNtQvLZDY24R9qG5b3W9mZGvO01DTLK2GwO6ratcZIn7nlpFmSukTHw0YCs9WeI15z17abf2SULTsSaS0UrhYyLKgunRT/F/itISS8+efmqElcxD6AbG8ZSLQjyvwYxrBXe4+V/2yzqVXTn7gEneqJHVGD5o0CJ5pgHZkyE= 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=Xn63ZtPJ; arc=none smtp.client-ip=209.85.128.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="Xn63ZtPJ" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42172ed3597so14577235e9.0; Mon, 10 Jun 2024 01:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718007045; x=1718611845; 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=Xzz4FamyiPn8akR9ASl0Wy4HP8i0zYoG2pk7jvrBsjU=; b=Xn63ZtPJX/GlyAZmPJ17t9JB1yQj77dOlAE64oFD8pTGFMhxJYyLn3a0AWQZb5a//j aRKL2+brtYg7jTwJHr+t565DdZ9hc8kV9WmlOPyMnQpOANi5vcjCcZNSKvrxYxbngs+0 shJ5foWLLPjrRajx6a5QDupA5bS3vqWz8OXidQfBRSsVkGcGj0BOWevFS9qouDRyEh6a 1QWDPuEElYRfgx1Vnfw95JO1hmMwY9APagtDafLa7HLAVjo4NN7yiQmCNKP8BzyiVIap vVBFDuV7Q1JJcXAsYvSZLNsFs3TTPHy+LUxd2ry0BiESqpDtFordGw03F4cFihK6JMGV xh/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718007045; x=1718611845; 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=Xzz4FamyiPn8akR9ASl0Wy4HP8i0zYoG2pk7jvrBsjU=; b=TgG7Nl+VrfERojyootQqNyPmJwN/wjogmDp0DkQi949PnGE4UqxHpQ/W0hRnzRQrQf PcFbcSb9+TjU0fdg+sZvHkOGNmG7OnpwaBWE210YFCBw4EByGRlr/KYoCnO5VLLWun7P qTu646hn7xrrRE16nySjCUweQsc9H8pv2ovafy/+e9azrIz5esWnuHX+1UI+bDAVSb5F SVIQ2VQrmM1ceWBCWly11ABfKuNcULFg0x29VOTjC3828+yoZzKz6rJMrM9Sw3FSTZdx baiI4/UHtTTW9pfWlHgNhkcJHF+fUF8gh2aympJp7tKEWDk08QwCEL8XAi/xdHwyJo9h oaOQ== X-Forwarded-Encrypted: i=1; AJvYcCUgAgmbolWMsrxERQE2aXXhNJCOjzUJQYKLIKj53suYf/oXp5WmVv+bgX/DIkMed8CvuxOv7Tje+6fpdzpHSRILo96TOxR8To+j7xqBuwWy6OpBI5Vuy72DLec0betCUfi3DcRGzMgQhc0= X-Gm-Message-State: AOJu0Yy0bnUDbp0QMAMteuw5z4DwVtty6xC3t2iYz3kHnoG787H9UDLp pUF6D2gB+HJgEzP0nM5KQMAuNYo+zrxeXnGkEPJqzp8vFolIMoSI X-Google-Smtp-Source: AGHT+IEhmddEeIGjHLLKnZBDu0edUL6m8XjMUSFPIt/L/8Vdp6c5N0iw41CwRStbHAD8WgZDohgKYQ== X-Received: by 2002:a05:600c:26c2:b0:421:79b5:6d84 with SMTP id 5b1f17b1804b1-42179b56f95mr58553485e9.17.1718007045421; Mon, 10 Jun 2024 01:10:45 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-58-5.cust.vodafonedsl.it. [188.217.58.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm18021315e9.35.2024.06.10.01.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:10:44 -0700 (PDT) From: Tommaso Merciai To: Cc: linuxfancy@googlegroups.com, sakari.ailus@linux.intel.com, martin.hecht@avnet.eu, tomm.merciai@gmail.com, michael.roeder@avnet.eu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] media: i2c: alvium: implement enum_frame_size Date: Mon, 10 Jun 2024 10:10:33 +0200 Message-Id: <20240610081034.1195523-5-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610081034.1195523-1-tomm.merciai@gmail.com> References: <20240610081034.1195523-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 a88809333e56..c27c6fcaede4 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1722,6 +1722,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) { @@ -2229,6 +2250,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 Mon Jun 10 08:10:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 13691647 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.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 3D3677CF18; Mon, 10 Jun 2024 08:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007050; cv=none; b=CVxpYyua5VDZnzCBQbH4oBIpaZfM6QSnZQIkSZU0Pcbk/j/SumtBAEHgTp5rakuwxDS6oyE2NOxfH7KtiFaOX+68S2Wvn+o+PzRJC6N6YqM5rVCaUNTymVs5sfAbJx9WLCc29oguJgjTPWlTYjryuD4SZ84MVNzT1/7nueLGprY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718007050; c=relaxed/simple; bh=FPYgt0uQnuu9rVeb6mqAkHHMzyf72rmBAdsSkxeGWyg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=npI1pxb99UkAzjJx3eyjXpb+bTSK3ihuzqrX2eH/0cUB1ZU2B4RTqVxW8l4R8fnHeoFzjPMQv98apj5i+h+YtxsCD0GtUaoF5dedsMe8bLkcpYqZkOUZb9M02DL4iJiSGsL9TuTn5hxzdZXf+xOjRcGkK8wFnb8h/OqGh5/OrKg= 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=DG5jNo7q; arc=none smtp.client-ip=209.85.128.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="DG5jNo7q" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42178999284so15499845e9.0; Mon, 10 Jun 2024 01:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718007047; x=1718611847; 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=rQDBi3oYV+NYdF5KcjHpsbF8q4F5N4Z3vnTslnJR8BM=; b=DG5jNo7qpsQZi2a9v2ErUkLuysKp+u0Do1u+DuhIN+DcKwEkIcshTJs5z2dPYphSQK Ao6lTMvuVJEWZaxmFzLIOMMrmZGU2RrBYlAWbnH4541+A96nzfxH6SoXRoha0AF1itN6 5DlghpPti4Ewmn/WVXCRQQrnFmIbVhyXZnafoSHJrVimUSr7AXgWfarzjE0oBP7Y2PyB a0uUguqW3Jqo7mKhMSWI0bW0vnFg5zX+cdAfVXeX+gxsu3EBkvhzbLEJuZYsIouRazS2 ZVJdVC6vMrxk/g+dvmyOvYCgu137ZO9H/i0k+sz3woUo4T22ZVDBu+cTBJbyYSCnw2Cu MxPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718007047; x=1718611847; 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=rQDBi3oYV+NYdF5KcjHpsbF8q4F5N4Z3vnTslnJR8BM=; b=NSILX5Or8Y5MeiwOnoWb4XKv8Dzim6iUAZ+sNPoxAS+E8pDGocwUsEwjEzuUqsw5oS ZVCLNUOf3bdUyRyUuoadp+Ly+O5hRwjC69ZIkxOjuOcoEZ3LtuG5Vtbk9kSqcMhAE33K cRbBvIWQddmECprFqW3U7mt3szTWAXVOFa4TMyuiXAc4qvFeTjHokycHriLOP2nfTX6P any01acDiCH7XiJzZgjZd8mbtHQe/9qaHzSHv7lJZJTHNsB+NEBi2nwrtrOXnAgTybin dC3Eh8LiL1oT6dBEzzRssf+VSYnlwBO4pKoXZAYg4ibRjl3rafYXQAol4I9YPibP5d94 dsfw== X-Forwarded-Encrypted: i=1; AJvYcCXXEoyZplb/ArjWwOKyTZJpsK7cSxw3yYW8ZHkTkFgK7HzQC7Tm/pWa5+ftP4ZVQHK1jm/xyLGpmwkOjpR3R0zPyP6z3RUdj5cHkJ63CqQbnPrNYIHpSsyOpzbXMbzGGdpSno7Qz2StxsTQP67YZMEaIC5E2g0uSvRAu72LtsSZLPk= X-Gm-Message-State: AOJu0YxpUePGxHEByRuANoX/D+0DU7GgrfjDLvNXq0TvcqAeGz6tSCo3 R90cK0bXn1ghundoPFzPjggtxM8T09zqqm2zTpnyXnziVO9sF6WDHut+FA== X-Google-Smtp-Source: AGHT+IGQI3Yy+38G5bokS7IeW8adF4Lqb0x/W1g6fUDN5Dr1XGIwhCaj6AP2pGGIw5rbe8aTXI8W9g== X-Received: by 2002:a05:600c:3d09:b0:41a:c86e:a4db with SMTP id 5b1f17b1804b1-421649fbd32mr69331535e9.9.1718007047580; Mon, 10 Jun 2024 01:10:47 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation.station (net-188-217-58-5.cust.vodafonedsl.it. [188.217.58.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421e91c47b4sm18021315e9.35.2024.06.10.01.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:10:47 -0700 (PDT) From: Tommaso Merciai To: Cc: linuxfancy@googlegroups.com, sakari.ailus@linux.intel.com, martin.hecht@avnet.eu, tomm.merciai@gmail.com, michael.roeder@avnet.eu, stable@vger.kernel.org, Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] media: i2c: alvium: Move V4L2_CID_GAIN to V4L2_CID_ANALOG_GAIN Date: Mon, 10 Jun 2024 10:10:34 +0200 Message-Id: <20240610081034.1195523-6-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610081034.1195523-1-tomm.merciai@gmail.com> References: <20240610081034.1195523-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. Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera") Cc: stable@vger.kernel.org Signed-off-by: Tommaso Merciai --- Changes since v1: - Added Cc and Fixes tags as suggested by SAilus 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 c27c6fcaede4..5ddfd3dcb188 100644 --- a/drivers/media/i2c/alvium-csi2.c +++ b/drivers/media/i2c/alvium-csi2.c @@ -1998,7 +1998,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; @@ -2030,7 +2030,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: @@ -2159,7 +2159,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,