From nobody Tue Apr 7 05:43:50 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4675D3E959F for ; Mon, 16 Mar 2026 18:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773687296; cv=none; b=l5zBCry0u8HzZBBVdc7jOHk5Rabnifh29hX6O0ra3z41IKgs5YpOpRMv/dXQ2WQgGy0IxOp630/w2/E17w/d8qWBVgvg8aZdbSmxmFG+1GDzGVBCD6CUfapFAzoChtcSd4HWSd4cNAUJFqEs+AmMznNqzaqowomccQKjYUdrm+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773687296; c=relaxed/simple; bh=phlz7lNAhvXN0hEIT6ClaBZaJ7P5qlMteCFYP4WlGM8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aMd80hz8zYL7K/0QZjvVV0T851UYcUKj/FEIqxwObA/Wl7on/g/6CYkUx6DYq90A10P+RJp62UVKG9p7wTWpj1fGGtvIpsMuEjwiigECRmbleNfnYmIy5buRyZtZJwvLX7zEUEsd8ZIwwjJH7EzMxXs6WnjSMI1pLRxnUNw1pEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=OMkp0ZCm; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IPr8MiH3; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="OMkp0ZCm"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IPr8MiH3" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62GEg9UE3295286 for ; Mon, 16 Mar 2026 18:54:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= OflPgbJUeB9MU802D7Qb7B2sM8brxEZYSrbm3iiUBSI=; b=OMkp0ZCmPlTUwlQk 61GlxeDYm4B3tzD4vY/OWrm6IDHKy7/qq+2uK0SBGjnDjvcun/fPbTd41g1eLy5m z1JgahrZvD/NPJ9ZtstIVVZVxPe1uHIghAASqloWJ4+s2WBP9kIgM4voC2qjOZ3X bqAE22zZEkhMW0+oRrqeyTEgzXvadBp7Uf6E5gkDk6Swih8D7UrmOxMuB98oL8YB 0WQ1DdKDbYRSNFInzXRt7mIn9tOUeee102rK+0zYUwdRY0X5roqDg53pf/L4OZIs KpLjJo+URRLFNIAf/N2IZmAOxIMeVrg6z18Kd95q5AZip3uz/a5m/CpDFD7+Jd6N 1wuqTw== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cxkuy0vv7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 18:54:51 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cd7c4ab845so2323693185a.1 for ; Mon, 16 Mar 2026 11:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773687291; x=1774292091; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OflPgbJUeB9MU802D7Qb7B2sM8brxEZYSrbm3iiUBSI=; b=IPr8MiH3f9oZdJf0+jnbCylnAb1NQxE/3qqOKlDKDH00c3zzA9DX8M6rsQS6x8xbbI fwCSc1RQ7M35oiS4EZWz69ratStis++xAZFghHed70Kaou90BGBYd4SAiZx/a5qPSBGX dzYL0UsLcRwwyR2wg/94/Qoa8Lgqa/WHD0Gj0j1rtORjypADaadoBYE9CiAGVaJK/Ukt J2gXX6j5uay6AwXKAJDQ5C02B7kD4xb2XQd+FG4iqDzgeYCHFNX+uYGXpTwB+Gg0lneQ THXGznEapH5O5g7BFGNhXa5JdbQob5BT9YEFKKAr2dpEH3vUbCRmpKKPbR1n67+wFmg6 0OQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773687291; x=1774292091; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OflPgbJUeB9MU802D7Qb7B2sM8brxEZYSrbm3iiUBSI=; b=lq/xXJtkdG5ySvzfmfE2nbj6v8TqGGsvCCICsmoHSygGlGgrlmSV3LrfDhkQHWB6QR xIbPhxA3XXTLQTQpNvxrDdm9oGV1ZZfG/u4cJAFKurw7pVlSpsWy+z878gdvvjxsm65p mHLwLcAY8EXyIc61oEH1k4uPMu9t4vJguA34s810SCuN2gdyTeDq1CFds7ESfFyDpOKV lljYsV2c16Ve5QOtQ7W/n1BKYyCbfoKQqFgC6ThVKzfnu5qPTdNzw5G8DEGagbzH6MZZ UOfAojuFEgGONxBC2klM/cHDDl7jYg4It35Azam+MwZFa5p4ar3uBMFOaN5Hz6mw0ons cIqQ== X-Forwarded-Encrypted: i=1; AJvYcCWZP6tNC0q12rVC2sv9JL7VzUbvT+cJXZjn0sVDXntIpGSYqO2kbMk53A5N6xRPjNe2dy/pLxjDuK3ERDA=@vger.kernel.org X-Gm-Message-State: AOJu0YzpNuNmfeVoWqxXvm0rm/r1YMIXp6vwzfJErULf1/ZKXYTBAVhV ApxWO82w3/SJxFY2Iisp9B8jKG1vSbOXGN5de7+m0TO9dZ5+AZ8v+slINM/A7mvNFwG+vaNVBTb H+rRAIZeEH9L2yK8nc1aZ6vYuBPXFB4s5G8P1hR8R72weqBjgqXtlOJAji05BuUv6I2w= X-Gm-Gg: ATEYQzwWhsGfzrS6ANRIPn/xqQI7qtQsKqasIrPjeUOu3oBv7mrA/vfXXD441jrmmrQ +aMiD67mtSUwAdksamKWGt55+xB1DQAaRGZwT4Ts4pO9CSjCzPvGMBPQ6jz7P2nBZnfIia7YQaM JZelZRuAPjhFPV2C8m/tHM4vXM7KDr1HDPPYdF6kvH09Yu0lmGbl3BDHG8s+RNjLocaOglR3jWO eOVFkkC3Yy1dkeFa6CpfCDhNmIZCLUtjECMtKIkmUWk96he7YdDwT2B8FGqord5WiBYG6OQ21W0 n5sYgVxdHiMQpwJ5vZ+74YRq3FpJDjgL9ERBGob0IkBn61vF9GmCR8UnfLKJpTCElTjNVLgyNYY kz+vjHMGcN1S5b2JJ6MpWOuK4Zh98aDnc5hbWSki+1291fWJrM9OoEp18Z3OlsCPKMbvQ9rt6Yz LliKFQBLHI3duNFCMqDHcF87PrCKVgjltWZdo= X-Received: by 2002:a05:620a:a1cb:20b0:8cd:d921:7075 with SMTP id af79cd13be357-8cdd92170d5mr380543985a.71.1773687291148; Mon, 16 Mar 2026 11:54:51 -0700 (PDT) X-Received: by 2002:a05:620a:a1cb:20b0:8cd:d921:7075 with SMTP id af79cd13be357-8cdd92170d5mr380541585a.71.1773687290667; Mon, 16 Mar 2026 11:54:50 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-38a67e6788csm34108041fa.33.2026.03.16.11.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 11:54:48 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 16 Mar 2026 20:54:40 +0200 Subject: [PATCH v7 2/8] media: qcom: iris: use common set_preset_registers function Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260316-iris-platform-data-v7-2-fc79f003f51c@oss.qualcomm.com> References: <20260316-iris-platform-data-v7-0-fc79f003f51c@oss.qualcomm.com> In-Reply-To: <20260316-iris-platform-data-v7-0-fc79f003f51c@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6499; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=phlz7lNAhvXN0hEIT6ClaBZaJ7P5qlMteCFYP4WlGM8=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ+aOwC+nXFItOQr6jnzaX76J+/DG5xleG70K3TTmbVkoq Bt0JiW4k9GYhYGRi0FWTJHFp6Blasym5LAPO6bWwwxiZQKZwsDFKQATOanJwTBVzsjeT8FK8+0r lsRa39IvYXVP1rrUZ7k1/uQ5+MlJPsPsbaK4v03yRb9ZRSeb1SLbQ0T0t/lsFJvUtc1ZRD/jSve DPeE+1wrnn3hfeIPp6JnYbv6YU2unSt0uKvwtEv6tSjPB5kjexJXvnVO/V1/iVzXikf38MHJ3l3 +ircFyn4Brmxr5K81aOncGTHXYMW/FBIvW2D1xDOvDrwhF+yesMfkln13Gs0prttoZy4U7/k/kc F/xpTH4U5ZM7FdtnpTgrztV3ggYGRTJKaw1+N088X0ce9nru4lrXj3XF3kF9IV9VGelUDJ/Afdb nkbzumy/HwFPbJf5n9CV5N92/aF/S8wcoX9XVHVusAAA X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=br1BxUai c=1 sm=1 tr=0 ts=69b851fb cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=LmgrmXmU8fDMlo1BKrQA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDE1MCBTYWx0ZWRfX6k2+xAm0V3yr HhqCxyWXjiQFUtrGMhwksHaCdm+9WqYkOQAYjxxjBdQ4ZZb/tqfcf2sRZdy64rIogMi4owPPfmV I1VDhi7VS1ZRyFha2TnK8Omiq1jU/q+o9WSU8jlziIh/fDo1Pwn7b5EFRTPueGef879UpGglPUX pXe0lx9/F0fw0vMCBbOT1opvdn9xSlMhGMnZBTd8t8e373PWKnjW2WHln4YVn2M0fxbzDJ2Bt40 kFv517t88amq71umqhAl396wONJoZpOW+d9e7mmKQ7KJ/NBWAL1JYDwfXmQ/wnEckwD3wn9ulAX eYEAcBx975J7gEfE+E7C/Q51SlD+VQmTlIlsO0yi8QO5ndOqt6iD3c35Tk/ff1PyRfGnPuKV6K4 CRpfby3qHUD0OhiIJr9QRSi8JYAnBKBTcE4c0aKCU/ykunO1v4nx4pq5PuaGVXX9pI2m3HYGVGV bXMuEU/8+xGg+Mx27IQ== X-Proofpoint-ORIG-GUID: OSM-K3fMc73mV9jnE4_OkGbzR4EN3Rfd X-Proofpoint-GUID: OSM-K3fMc73mV9jnE4_OkGbzR4EN3Rfd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_05,2026-03-16_06,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160150 The set_preset_registers is (currently) common to all supported devices. Extract it to a iris_vpu_common.c and call it directly from iris_vpu_power_on(). Later, if any of the devices requires special handling, it can be sorted out separately. Reviewed-by: Dikshita Agarwal Signed-off-by: Dmitry Baryshkov Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_platform_common.h | 1 - drivers/media/platform/qcom/iris/iris_platform_gen1.c | 7 ------- drivers/media/platform/qcom/iris/iris_platform_gen2.c | 9 --------- drivers/media/platform/qcom/iris/iris_vpu_common.c | 7 ++++++- drivers/media/platform/qcom/iris/iris_vpu_common.h | 2 ++ 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index e4eefc646c7f..d7106902698c 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -207,7 +207,6 @@ struct iris_platform_data { struct iris_inst *(*get_instance)(void); u32 (*get_vpu_buffer_size)(struct iris_inst *inst, enum iris_buffer_type = buffer_type); const struct vpu_ops *vpu_ops; - void (*set_preset_registers)(struct iris_core *core); const struct icc_info *icc_tbl; unsigned int icc_tbl_size; const struct bw_info *bw_tbl_dec; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/driver= s/media/platform/qcom/iris/iris_platform_gen1.c index 07ed572e895b..ed07d1b00e43 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c @@ -260,11 +260,6 @@ static struct platform_inst_caps platform_inst_cap_sm8= 250 =3D { .max_operating_rate =3D MAXIMUM_FPS, }; =20 -static void iris_set_sm8250_preset_registers(struct iris_core *core) -{ - writel(0x0, core->reg_base + 0xB0088); -} - static const struct icc_info sm8250_icc_table[] =3D { { "cpu-cfg", 1000, 1000 }, { "video-mem", 1000, 15000000 }, @@ -343,7 +338,6 @@ const struct iris_platform_data sm8250_data =3D { .init_hfi_response_ops =3D iris_hfi_gen1_response_ops_init, .get_vpu_buffer_size =3D iris_vpu_buf_size, .vpu_ops =3D &iris_vpu2_ops, - .set_preset_registers =3D iris_set_sm8250_preset_registers, .icc_tbl =3D sm8250_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), .clk_rst_tbl =3D sm8250_clk_reset_table, @@ -397,7 +391,6 @@ const struct iris_platform_data sc7280_data =3D { .init_hfi_response_ops =3D iris_hfi_gen1_response_ops_init, .get_vpu_buffer_size =3D iris_vpu_buf_size, .vpu_ops =3D &iris_vpu2_ops, - .set_preset_registers =3D iris_set_sm8250_preset_registers, .icc_tbl =3D sm8250_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), .bw_tbl_dec =3D sc7280_bw_table_dec, diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 1f23ddb972f0..c84d4399f84d 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -756,11 +756,6 @@ static struct platform_inst_caps platform_inst_cap_sm8= 550 =3D { .max_operating_rate =3D MAXIMUM_FPS, }; =20 -static void iris_set_sm8550_preset_registers(struct iris_core *core) -{ - writel(0x0, core->reg_base + 0xB0088); -} - static const struct icc_info sm8550_icc_table[] =3D { { "cpu-cfg", 1000, 1000 }, { "video-mem", 1000, 15000000 }, @@ -917,7 +912,6 @@ const struct iris_platform_data sm8550_data =3D { .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, .get_vpu_buffer_size =3D iris_vpu_buf_size, .vpu_ops =3D &iris_vpu3_ops, - .set_preset_registers =3D iris_set_sm8550_preset_registers, .icc_tbl =3D sm8550_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), .clk_rst_tbl =3D sm8550_clk_reset_table, @@ -1018,7 +1012,6 @@ const struct iris_platform_data sm8650_data =3D { .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, .get_vpu_buffer_size =3D iris_vpu33_buf_size, .vpu_ops =3D &iris_vpu33_ops, - .set_preset_registers =3D iris_set_sm8550_preset_registers, .icc_tbl =3D sm8550_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), .clk_rst_tbl =3D sm8650_clk_reset_table, @@ -1114,7 +1107,6 @@ const struct iris_platform_data sm8750_data =3D { .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, .get_vpu_buffer_size =3D iris_vpu33_buf_size, .vpu_ops =3D &iris_vpu35_ops, - .set_preset_registers =3D iris_set_sm8550_preset_registers, .icc_tbl =3D sm8550_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), .clk_rst_tbl =3D sm8750_clk_reset_table, @@ -1212,7 +1204,6 @@ const struct iris_platform_data qcs8300_data =3D { .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, .get_vpu_buffer_size =3D iris_vpu_buf_size, .vpu_ops =3D &iris_vpu3_ops, - .set_preset_registers =3D iris_set_sm8550_preset_registers, .icc_tbl =3D sm8550_icc_table, .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), .clk_rst_tbl =3D sm8550_clk_reset_table, diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 548e5f1727fd..faabf53126f3 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -468,7 +468,7 @@ int iris_vpu_power_on(struct iris_core *core) =20 iris_opp_set_rate(core->dev, freq); =20 - core->iris_platform_data->set_preset_registers(core); + iris_vpu_set_preset_registers(core); =20 iris_vpu_interrupt_init(core); core->intr_status =3D 0; @@ -485,3 +485,8 @@ int iris_vpu_power_on(struct iris_core *core) =20 return ret; } + +void iris_vpu_set_preset_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + 0xb0088); +} diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index f6dffc613b82..07728c4c72b6 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -39,4 +39,6 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_core= *core); void iris_vpu35_vpu4x_program_bootup_registers(struct iris_core *core); u64 iris_vpu3x_vpu4x_calculate_frequency(struct iris_inst *inst, size_t da= ta_size); =20 +void iris_vpu_set_preset_registers(struct iris_core *core); + #endif --=20 2.47.3