From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796123955; b=xBXvUDVkUmjjVwfYCBdQK3u+qEPybDN8/QeNqCd2OhugrG9mnKk/FB9JGc3m436GJ+wP JoQqMlBFi34T4VOcg9BCFTToVJjIetOFZiVO18l93LS0tJeZ7VFU4bjvJo68rqb1SES5b DyUDqrIV8KIHlPsvTIRxy1NwojU9NHqJd7vRJjGLcnzSs1NLeHd1UCIfqs4xP73clFL+k FYF52HrZHTU1v1f44xCmsoOL9TYAe7mksDHacw3oXP9S2OloEtwNzLEeEYgtRRbTdGlB9 8MBmx7c0feNszNSbvhkxgBrY0oMCa0eZED5yGux36xXbBvTh8ABGt6EL6vJ0Pe2U4pA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796123955; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-Spam-Details-Enc: X-Authority-Analysis:X-Proofpoint-Spam-Info:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=bObGZqqbT9B7qNKdKdjYVgfEd2hPJ4SequXddM7sTzA=; b=5fDtecRbkhABs6rLr5UnbdxySrj62H+tzhtPJ4dYFUNwjHqoyU8z4eAaZ2EcmuVn5+2C Vyp27XCUxUrYUOLEFpy1ZtzH+Sm23KSHfWJaX8UHb9/WcYzD6lXTd3P9mF3LGBkXo+bHa ff6bmqJXgccQZ5sT2nJq8JxszVp0Ap/ncn5Qtk7yXC7xCj4BwyF1T0UxXCKAwCkCth12e N4tMT2NkSo9LZ3wm2QyGpsHCMKYOpsJ0a+F7YryPMBLYwyT7/xZFBvZVfC9xF+gwp+ps0 S+76ODg6pS91h3gfJ9E6iND4ULtQ6nHoG8GL6KeoLqZbykxtp/S3X/guP/qwGV9bdng== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=m55N5MDZ; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=QQR+T8cp; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 739FE606A33B for ; Tue, 1 Dec 2026 11:19:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 739FE606A33B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=m55N5MDZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=QQR+T8cp 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 6B1AQP4u1483872 for ; Tue, 1 Dec 2026 11:19:12 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= bObGZqqbT9B7qNKdKdjYVgfEd2hPJ4SequXddM7sTzA=; b=m55N5MDZT7o2Wmr3 MbyNkHawwFVpWwxKixVMPxmFMLnD7qFb5zDfoDWdXnQti/ag+Ty7EQdIpoXEy73x GE7i2KEdN97lLGJlnePq7JmGLJzesfbzdvB5q3twdUJRwStR8SXFsp7uZBcrtbWK 4hchZrwrRcTnJ91QUO3pqxggtsh6io/kVIZ5C3PIe41FMRta2yy6gPjb8R03i9Gr CB358HzqtVimkK8Qw08FRBXcVTOJy7Xe/Cs0aC924FecqgKArtz6SX6enecD8Wfh xEzRlx7mpKoW2BFD1K5sSvvfKU5rlrgCqzxXVXUivDnXqY8+pHWSedUxNq1FWqIa 2luajA== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j9qn4sj1y-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 11:19:12 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-93f26dd2165so2802075785a.3 for ; Tue, 01 Dec 2026 03:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796123952; x=1796728752; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=bObGZqqbT9B7qNKdKdjYVgfEd2hPJ4SequXddM7sTzA=; b=QQR+T8cp2UCIrfzKNlq2Fgx0IfmBy7zwlIXjR5uG+rrfnIpIc9qoQzbtR31ddttwTH CjArKIzs0NlngPmyN6kCojvImh1NFR/Zhwz+yXOeJvkHBsFcVwbTnKow6LllpYOZD92d So96E7GSRFImdLIFtPDayvjjVO8awm/8YVKJ1HWpC+QArFs6gXqpQliwldGfqvUBRsGs M4SzQJd+Gxi6zmqwjFV35OfRj5wPBqIh0abxpJWHxmyziriSYwpsKDluCo09PJYeeuDT uPGi7LeYuOl7omkhpdQ8cyhSBE4rYLZc82PzqRCZ5WjY7tzcA+NNhxi2dYRGvfr4E0oL chAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796123952; x=1796728752; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bObGZqqbT9B7qNKdKdjYVgfEd2hPJ4SequXddM7sTzA=; b=IqGAmnwAELXFyc977G4gGpv0wxpFtxGdSdajkmrQvZW3f+70n+WKv0a880gFubNzih RCqbCGqNn+osX4ny6XsmlILrEsDYSalcoJLMvoxk8cYPWqrJv6cfpY4mHQbPzM5M8aWm pH5EIpD0zwrD1dKKZL6QGHCiJT7iMnTTBI+7UvaeADkvjIUhEnkwgniMJRq34tGvgB+7 4+dXBmZWoLB2wmthT3oOEu96eMhoXA8UmLHKh11SjD42NiZig9UgGil8j54B7CHdC9kk n5X5R5t/NxLYRIDMbqmmgOAiDrBMEflcVwPmhgxDstRAlUss8jzf/LeqXU/mG7g5C+m+ FLaA== X-Forwarded-Encrypted: i=1; AL+hErHyjrzY+dAsaxCIfruK1H2mUTRBuxJLkkZJH9hcNODEF/FQMXzzV0doU+7cdDh/hDEQOnIjmgUp6AJaYnU=@vger.kernel.org X-Gm-Message-State: APuU4Z9XScjPOJ+/Bj4qmBM6K6oUOUCp97ed+k4RbvzmxmEg+ZB8BQ8O 5yTMceE6doWbmShljpgUOG0QayhBcq7gskrcAdn5KLheySDUDLZh/qTdNI8bOCaU2alMl+XQRDE NRrt/vDevKS6XE69PFTwE9uw9y/QSLykiKrAFDRBgYYgxhpMNBvL8ad8xYQRK+JI5YXB8qo48ka o= X-Gm-Gg: AZFdTZcc/xJM+vj2AOa51IQGUcXCZWJvIC7qfXVgyu24cRWavD6MRsuANOi+YMUg5/J kQOZbtM9m2heajz8zNYhyvEylzGlqkueL11P3VGyv/Lidi8GY9khSU6Pf9xJ+lrMGCLJ7djdyOy r8NvmhIu42h81z3wRp1dqTznVLNRHgfiPfKg6IVmv6Vr0UWIBJzwBmIqbza4Y/o2uhMjj63mlGO VWzgPPQEe2LIID9OgDTaRf5hA+9bLegUPyAv4YFZn5VgYzciIK21fagNM+PQnz4hfn6GJOGYYT+ 4oPXBDkHcXRPTpL7zsHvHSFXmSFbEO2JH3yG/Kk+zzkIimzfAmkGSnKg30XuHbN29jb1Z4+eylV KJjzJWie7KFOYkzn6154JQKWHJa6Th6dNE8wdIOKX5cbsAWBPsyD+V3B1mMpcu0Vzulj6Qqzi2x Oxq81AXTlzTt3C X-Received: by 2002:a05:620a:2907:b0:949:72c3:dee6 with SMTP id af79cd13be357-949ba99cbf7mr6682981585a.19.1796123951498; Tue, 01 Dec 2026 03:19:11 -0800 (PST) X-Received: by 2002:a05:620a:2907:b0:949:72c3:dee6 with SMTP id af79cd13be357-949ba99cbf7mr6682976285a.19.1796123951028; Tue, 01 Dec 2026 03:19:11 -0800 (PST) Received: from [192.168.25.64] ([94.155.124.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbab390cf5sm581356485e9.7.2026.12.01.03.19.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 03:19:10 -0800 (PST) Message-ID: Date: Tue, 1 Dec 2026 13:19:09 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/8] media: qcom: camss: csid: Add an operation to read the SOF timestamp To: Loic Poulain , Mauro Carvalho Chehab , Bryan O'Donoghue , Vladimir Zapolskiy Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20261127-camss-hw-ts-v3-0-e4b6ad98ce9c@oss.qualcomm.com> <20261127-camss-hw-ts-v3-1-e4b6ad98ce9c@oss.qualcomm.com> Content-Language: en-US From: "Gjorgji Rosikopulos (Consultant)" In-Reply-To: <20261127-camss-hw-ts-v3-1-e4b6ad98ce9c@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA0NCBTYWx0ZWRfX0NRUX7/4ItIq 6VYg/qxojFeCBuiN8fS1+gpuZWEjN1JFKWXh9FLsW3KIL0GrQInbIa4N64qZGd+yW0BZcm2V18t YJhmPsFPuqc/EFoJxXmcoU6CDdhj+bX4tAsAkDvfbW1oAZduBc/wOUTL0Z3eLAEAmWnbSXElcp2 aYHWLnohXnU0SoUdM/m5ZZm2oRil5BaFTnRATdKpnpTpQRwQoUPuMQxiUxv5z+wxu65TCgEWsvz nUhIhr5hSse9F1VZdvY7ORh1fJ1iPZ59Obf0KSrHwwk2ryTnKf8RTUlfRJlgNShvJVSkVG+31Ve 5vQ1bFw14UzMtxYRolon3dqr1nmYgE+Pxiv8p3XBD/V1qzr+sr3qwgOR1KH02M4QcBuA7dUHXuj Ctfp3toyAAlZSMTlU6FMw63DxmYRAnQAjXe13mUWlQh7hu/nzVa9MW0RX/2347jyS+cfzJ7Y62y jMGR0xW3iaZmAH+dElQ== X-Authority-Analysis: v=2.4 cv=JoBkP84C c=1 sm=1 tr=0 ts=6b0ead30 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=eGCDHFSXubCXFTSSGhjuOA==:17 a=n8IlR8rfZ27013JM:21 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=-AphQqvNirx0Tr1eS-wA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA0NCBTYWx0ZWRfX3VA1x14EQfKA CUcXxlxnBgPyNNLn+PwGkQC+giSCnLRtqtOq+vlcmgNTSLiwINf/UN1xWytLJOtGP5w8ee8Nl6j 6PUvPrs8oH5Q4tbZCj5ysCVNbtcIYqY= X-Proofpoint-GUID: Dlrp2k6CP7t15Bto7X2tRYHBHqKFlyyK X-Proofpoint-ORIG-GUID: Dlrp2k6CP7t15Bto7X2tRYHBHqKFlyyK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_02,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 phishscore=0 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010044 Hi Loic, On 11/27/2026 6:11 PM, Loic Poulain wrote: > Modern CSID revisions latch the global timestamp counter at SOF. That > counter is the ARM architected counter, so correlating it with > CLOCK_MONOTONIC through ktime_get_snapshot_id() turns the latched value > into the time the frame actually started, rather than the time the > interrupt handler ran. > > Add a hardware operation returning that counter value and do the > correlation in one place, leaving a CSID revision with nothing to do but > read its own registers. Keep the result for the frame being captured so > a consumer can pick it up the same way it already picks up the SOF > sequence number. Revisions not implementing the operation keep reporting > the time the SOF interrupt was handled. > > Suggested-by: Bryan O'Donoghue > Signed-off-by: Loic Poulain > --- > drivers/media/platform/qcom/camss/camss-csid.c | 112 ++++++++++++++++++++++++- > drivers/media/platform/qcom/camss/camss-csid.h | 19 +++++ > 2 files changed, 129 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c > index 588122beec854ae5b78de9997b68c7a81d4207e1..436478fe1f65642ff11ae3707df726d619801a8d 100644 > --- a/drivers/media/platform/qcom/camss/camss-csid.c > +++ b/drivers/media/platform/qcom/camss/camss-csid.c > @@ -8,14 +8,17 @@ > * Copyright (C) 2015-2018 Linaro Ltd. > */ > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -37,6 +40,16 @@ > > #define LANE_CFG_BITWIDTH 4 > > +/* > + * The CSID latches the global timestamp counter on SOF. That counter is > + * the ARM architected counter, 56 bit wide and ticking at 19.2 MHz. > + */ > +#define CSID_TIMESTAMP_WIDTH 56 > +#define CSID_TIMESTAMP_MASK GENMASK_ULL(CSID_TIMESTAMP_WIDTH - 1, 0) > +#define CSID_TIMESTAMP_NS_MUL 10000 /* NSEC_PER_SEC / 19.2 MHz, reduced */ > +#define CSID_TIMESTAMP_NS_DIV 192 > +#define CSID_TIMESTAMP_MAX_AGE_NS (2 * NSEC_PER_MSEC) I am not sure if we need to move this in to per csid hw implementation. But as of today all of the hw use the same timer/precission i think i am ok with this as well. Just do add note. > + > #define MSM_CSID_NAME "msm_csid" > > const char * const csid_testgen_modes[] = { > @@ -779,9 +792,11 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) > } > > if (csid->phy.need_vc_update) { > - /* Set to -1 as we want to do atomic_inc_return to read */ > - for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) > + for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS; i++) { > + /* Set to -1 as we want to do atomic_inc_return to read */ > atomic_set(&csid->sof_seq[i], -1); > + atomic64_set(&csid->sof_ts[i], 0); > + } > > csid->res->hw_ops->configure_stream(csid, enable); > csid->phy.need_vc_update = false; > @@ -1370,14 +1385,107 @@ atomic_t *csid_get_sof_seq(struct media_pad *pad) > return &csid->sof_seq[pad->index - MSM_CSID_PAD_FIRST_SRC]; > } > > +atomic64_t *csid_get_sof_ts(struct media_pad *pad) > +{ > + struct csid_device *csid; > + > + if (!pad || pad->index < MSM_CSID_PAD_FIRST_SRC) > + return NULL; > + > + csid = v4l2_get_subdevdata(media_entity_to_v4l2_subdev(pad->entity)); > + if (!csid->res->frame_sync_en) > + return NULL; > + > + return &csid->sof_ts[pad->index - MSM_CSID_PAD_FIRST_SRC]; In the multistream patches i have added helper pad to port which does this conversino maybe can be taken as part of this series since i belive will be taken before multistream implementation. > +} > + > +static u64 csid_timestamp_to_ns(u64 ticks) > +{ > + return mul_u64_u32_div(ticks, CSID_TIMESTAMP_NS_MUL, CSID_TIMESTAMP_NS_DIV); > +} > + > +static u64 csid_timestamp_to_monotonic(struct csid_device *csid, u64 ticks) Some comment of the function will be good to mention that if arch counter is not available it will return just the monotonic timestamp. > +{ > + struct system_time_snapshot snap; > + u64 delta, delta_ns, now; > + > + ktime_get_snapshot_id(CLOCK_MONOTONIC, &snap); > + > + if (!snap.valid) { > + dev_warn_once(csid->camss->dev, > + "CSID%u: Can't use hardware timestamp, no clock snapshot\n", > + csid->id); > + return ktime_get_ns(); > + } > + > + now = ktime_to_ns(snap.systime); > + > + /* > + * Translating requires reading the counter the CSID latched from. > + * If timekeeping is driven by something else there is nothing to > + * correlate against, so report the time this event was handled. > + * Below CSID means clock-source ID. > + */ > + if (snap.cs_id != CSID_ARM_ARCH_COUNTER) { > + dev_warn_once(csid->camss->dev, > + "CSID%u: Can't use hardware timestamp, invalid clock source (%d)\n", > + csid->id, snap.cs_id); > + return now; > + } > + > + /* How long ago, in counter ticks, the timestamp was latched */ > + delta = (snap.cycles - ticks) & CSID_TIMESTAMP_MASK; > + delta_ns = csid_timestamp_to_ns(delta); > + > + /* Fall back rather than reporting a nonsensical timestamp */ > + if (delta_ns > now) { > + dev_warn_once(csid->camss->dev, > + "CSID%u: SOF timestamp predates CLOCK_MONOTONIC, ignoring\n", > + csid->id); > + return now; > + } > + > + if (delta_ns > CSID_TIMESTAMP_MAX_AGE_NS) > + dev_warn_ratelimited(csid->camss->dev, > + "CSID%u: Too slow! SOF timestamp is %llu us old\n", > + csid->id, delta_ns / NSEC_PER_USEC); > + > + return now - delta_ns; > +} > + > +static u64 csid_hw_sof_ts(struct csid_device *csid, unsigned int id) > +{ > + const struct csid_hw_ops *hw_ops = csid->res->hw_ops; > + u64 ticks; > + > + if (!hw_ops->sof_ts) > + return ktime_get_ns(); > + > + ticks = hw_ops->sof_ts(csid, id); > + > + /* > + * For double-buffered CSID registers, the CSID configuration is > + * only latched on the first SOF, so no timestamp is captured for > + * that first SOF. > + */ > + if (!ticks && atomic_read(&csid->sof_seq[id]) == -1) > + return ktime_get_ns(); > + > + return csid_timestamp_to_monotonic(csid, ticks); > +} > + > void csid_sof_event(struct csid_device *csid, unsigned int id) > { > + /* Read before the sequence number below, which arms the first SOF */ > + u64 ts = csid_hw_sof_ts(csid, id); > struct v4l2_event event = { > .type = V4L2_EVENT_FRAME_SYNC, > .u.frame_sync.frame_sequence = > atomic_inc_return(&csid->sof_seq[id]), > }; > > + atomic64_set(&csid->sof_ts[id], ts); > + > if (atomic_read(&csid->frame_sync_users)) > v4l2_event_queue(csid->subdev.devnode, &event); > } > diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h > index ccafdbf3a9fe0c282da68ccdd04661b3fab81ff5..f7c0935ea25cee5ac87cca470803a7391c12f9f0 100644 > --- a/drivers/media/platform/qcom/camss/camss-csid.h > +++ b/drivers/media/platform/qcom/camss/camss-csid.h > @@ -111,6 +111,15 @@ struct csid_hw_ops { > */ > int (*reset)(struct csid_device *csid); > > + /* > + * sof_ts - Read the counter value the hardware latched at SOF > + * @csid: CSID device > + * @id: CSID src-stream ID > + * > + * Return the raw counter value of the most recent SOF > + */ > + u64 (*sof_ts)(struct csid_device *csid, unsigned int id); > + > /* > * src_pad_code - Pick an output/src format based on the input/sink format > * @csid: CSID device > @@ -179,6 +188,7 @@ struct csid_device { > const struct csid_subdev_resources *res; > atomic_t frame_sync_users; > atomic_t sof_seq[MSM_CSID_MAX_SRC_STREAMS]; > + atomic64_t sof_ts[MSM_CSID_MAX_SRC_STREAMS]; I think we should group those two in structure struct { atomic_t seq; atomic64_t ts; } sof_info[MSM_CSID_MAX_SRC_STREAMS] I believe it may grow in the future. I am not sure if _info is needed it can be just sof. ~Gjorgji