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: 803153 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: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: 803152 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: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: 803151 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,