* [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
@ 2025-12-01 6:25 Hangxiang Ma
2025-12-01 12:20 ` Konrad Dybcio
0 siblings, 1 reply; 6+ messages in thread
From: Hangxiang Ma @ 2025-12-01 6:25 UTC (permalink / raw)
To: Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Todor Tomov,
Vladimir Zapolskiy, Mauro Carvalho Chehab, Bryan O'Donoghue
Cc: linux-i2c, linux-arm-msm, devicetree, linux-kernel, linux-media,
Hangxiang Ma
The current value of '0xb0' that represents the offset to the status
registers within the common registers of the CSIPHY has been changed on
the newer SOCs and it requires generalizing the macro using a new
variable 'common_status_offset'. This variable is initialized in the
csiphy_init() function.
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
---
This change introduces common_status_offset to replace the hardcoded
offset in CSIPHY_3PH_CMN_CSI_COMMON_STATUSn.
---
.../media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 19 +++++++++++++------
drivers/media/platform/qcom/camss/camss-csiphy.h | 1 +
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
index a229ba04b158..9b6a0535cdf8 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
@@ -46,7 +46,8 @@
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE BIT(7)
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B BIT(0)
#define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID BIT(1)
-#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n) ((offset) + 0xb0 + 0x4 * (n))
+#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, common_status_offset, n) \
+ ((offset) + (common_status_offset) + 0x4 * (n))
#define CSIPHY_DEFAULT_PARAMS 0
#define CSIPHY_LANE_ENABLE 1
@@ -714,13 +715,17 @@ static void csiphy_hw_version_read(struct csiphy_device *csiphy,
CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 6));
hw_version = readl_relaxed(csiphy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 12));
+ CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset,
+ regs->common_status_offset, 12));
hw_version |= readl_relaxed(csiphy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 13)) << 8;
+ CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset,
+ regs->common_status_offset, 13)) << 8;
hw_version |= readl_relaxed(csiphy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 14)) << 16;
+ CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset,
+ regs->common_status_offset, 14)) << 16;
hw_version |= readl_relaxed(csiphy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 15)) << 24;
+ CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset,
+ regs->common_status_offset, 15)) << 24;
dev_dbg(dev, "CSIPHY 3PH HW Version = 0x%08x\n", hw_version);
}
@@ -749,7 +754,8 @@ static irqreturn_t csiphy_isr(int irq, void *dev)
for (i = 0; i < 11; i++) {
int c = i + 22;
u8 val = readl_relaxed(csiphy->base +
- CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, i));
+ CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset,
+ regs->common_status_offset, i));
writel_relaxed(val, csiphy->base +
CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, c));
@@ -989,6 +995,7 @@ static int csiphy_init(struct csiphy_device *csiphy)
csiphy->regs = regs;
regs->offset = 0x800;
+ regs->common_status_offset = 0xb0;
switch (csiphy->camss->res->version) {
case CAMSS_845:
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/media/platform/qcom/camss/camss-csiphy.h
index 895f80003c44..2d5054819df7 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.h
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.h
@@ -90,6 +90,7 @@ struct csiphy_device_regs {
const struct csiphy_lane_regs *lane_regs;
int lane_array_size;
u32 offset;
+ u32 common_status_offset;
};
struct csiphy_device {
---
base-commit: 076fb8624c282c10aa8add9a4ae2d9354d2594cb
change-id: 20251021-make-csiphy-status-macro-cross-platform-5390dc128aee
Best regards,
--
Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
2025-12-01 6:25 [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform Hangxiang Ma
@ 2025-12-01 12:20 ` Konrad Dybcio
2025-12-01 14:48 ` Vijay Kumar Tumati
0 siblings, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2025-12-01 12:20 UTC (permalink / raw)
To: Hangxiang Ma, Loic Poulain, Robert Foss, Andi Shyti, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Todor Tomov,
Vladimir Zapolskiy, Mauro Carvalho Chehab, Bryan O'Donoghue
Cc: linux-i2c, linux-arm-msm, devicetree, linux-kernel, linux-media
On 12/1/25 7:25 AM, Hangxiang Ma wrote:
> The current value of '0xb0' that represents the offset to the status
> registers within the common registers of the CSIPHY has been changed on
> the newer SOCs and it requires generalizing the macro using a new
> variable 'common_status_offset'. This variable is initialized in the
> csiphy_init() function.
"offset" + "common_status_offset" is confusing
Let's maybe add some platform data where we store the actual offset of
the registers in question and pass a csiphy ptr as an argument
Konrad
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
2025-12-01 12:20 ` Konrad Dybcio
@ 2025-12-01 14:48 ` Vijay Kumar Tumati
2025-12-01 17:18 ` Konrad Dybcio
0 siblings, 1 reply; 6+ messages in thread
From: Vijay Kumar Tumati @ 2025-12-01 14:48 UTC (permalink / raw)
To: Konrad Dybcio, Hangxiang Ma, Loic Poulain, Robert Foss,
Andi Shyti, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Todor Tomov, Vladimir Zapolskiy, Mauro Carvalho Chehab,
Bryan O'Donoghue
Cc: linux-i2c, linux-arm-msm, devicetree, linux-kernel, linux-media
On 12/1/2025 4:20 AM, Konrad Dybcio wrote:
> On 12/1/25 7:25 AM, Hangxiang Ma wrote:
>> The current value of '0xb0' that represents the offset to the status
>> registers within the common registers of the CSIPHY has been changed on
>> the newer SOCs and it requires generalizing the macro using a new
>> variable 'common_status_offset'. This variable is initialized in the
>> csiphy_init() function.
> "offset" + "common_status_offset" is confusing
>
> Let's maybe add some platform data where we store the actual offset of
> the registers in question and pass a csiphy ptr as an argument
>
> Konrad
Hi Konrad, may be I didn't follow correctly. This is consistent with the
way we maintain the other SOC specific reg offsets / data in the CSIPHY
driver, in csiphy_device_regs, isn't it? I seem to think it's clearer
this way for the reader to see all the offsets at one place. No? Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
2025-12-01 14:48 ` Vijay Kumar Tumati
@ 2025-12-01 17:18 ` Konrad Dybcio
2025-12-03 16:57 ` Andi Shyti
0 siblings, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2025-12-01 17:18 UTC (permalink / raw)
To: Vijay Kumar Tumati, Hangxiang Ma, Loic Poulain, Robert Foss,
Andi Shyti, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Todor Tomov, Vladimir Zapolskiy, Mauro Carvalho Chehab,
Bryan O'Donoghue
Cc: linux-i2c, linux-arm-msm, devicetree, linux-kernel, linux-media
On 12/1/25 3:48 PM, Vijay Kumar Tumati wrote:
>
> On 12/1/2025 4:20 AM, Konrad Dybcio wrote:
>> On 12/1/25 7:25 AM, Hangxiang Ma wrote:
>>> The current value of '0xb0' that represents the offset to the status
>>> registers within the common registers of the CSIPHY has been changed on
>>> the newer SOCs and it requires generalizing the macro using a new
>>> variable 'common_status_offset'. This variable is initialized in the
>>> csiphy_init() function.
>> "offset" + "common_status_offset" is confusing
>>
>> Let's maybe add some platform data where we store the actual offset of
>> the registers in question and pass a csiphy ptr as an argument
>>
>> Konrad
> Hi Konrad, may be I didn't follow correctly. This is consistent with the way we maintain the other SOC specific reg offsets / data in the CSIPHY driver, in csiphy_device_regs, isn't it? I seem to think it's clearer this way for the reader to see all the offsets at one place. No? Thanks.
I thought this driver was a little more complex.. anyway, big
changes that will make this prettier are coming so this works too in
the meantime
Konrad
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
2025-12-01 17:18 ` Konrad Dybcio
@ 2025-12-03 16:57 ` Andi Shyti
2025-12-04 0:19 ` Bryan O'Donoghue
0 siblings, 1 reply; 6+ messages in thread
From: Andi Shyti @ 2025-12-03 16:57 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Vijay Kumar Tumati, Hangxiang Ma, Loic Poulain, Robert Foss,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Todor Tomov,
Vladimir Zapolskiy, Mauro Carvalho Chehab, Bryan O'Donoghue,
linux-i2c, linux-arm-msm, devicetree, linux-kernel, linux-media
Hi,
On Mon, Dec 01, 2025 at 06:18:51PM +0100, Konrad Dybcio wrote:
> On 12/1/25 3:48 PM, Vijay Kumar Tumati wrote:
> >
> > On 12/1/2025 4:20 AM, Konrad Dybcio wrote:
> >> On 12/1/25 7:25 AM, Hangxiang Ma wrote:
> >>> The current value of '0xb0' that represents the offset to the status
> >>> registers within the common registers of the CSIPHY has been changed on
> >>> the newer SOCs and it requires generalizing the macro using a new
> >>> variable 'common_status_offset'. This variable is initialized in the
> >>> csiphy_init() function.
> >> "offset" + "common_status_offset" is confusing
> >>
> >> Let's maybe add some platform data where we store the actual offset of
> >> the registers in question and pass a csiphy ptr as an argument
> >>
> >> Konrad
> > Hi Konrad, may be I didn't follow correctly. This is consistent with the way we maintain the other SOC specific reg offsets / data in the CSIPHY driver, in csiphy_device_regs, isn't it? I seem to think it's clearer this way for the reader to see all the offsets at one place. No? Thanks.
>
> I thought this driver was a little more complex.. anyway, big
> changes that will make this prettier are coming so this works too in
> the meantime
After this short discussion, in order to get it in, can someone
from Qualcomm ack/r-b it?
Thanks,
Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform
2025-12-03 16:57 ` Andi Shyti
@ 2025-12-04 0:19 ` Bryan O'Donoghue
0 siblings, 0 replies; 6+ messages in thread
From: Bryan O'Donoghue @ 2025-12-04 0:19 UTC (permalink / raw)
To: Andi Shyti, Konrad Dybcio
Cc: Vijay Kumar Tumati, Hangxiang Ma, Loic Poulain, Robert Foss,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Todor Tomov,
Vladimir Zapolskiy, Mauro Carvalho Chehab, linux-i2c,
linux-arm-msm, devicetree, linux-kernel, linux-media
On 03/12/2025 16:57, Andi Shyti wrote:
> Hi,
>
> On Mon, Dec 01, 2025 at 06:18:51PM +0100, Konrad Dybcio wrote:
>> On 12/1/25 3:48 PM, Vijay Kumar Tumati wrote:
>>>
>>> On 12/1/2025 4:20 AM, Konrad Dybcio wrote:
>>>> On 12/1/25 7:25 AM, Hangxiang Ma wrote:
>>>>> The current value of '0xb0' that represents the offset to the status
>>>>> registers within the common registers of the CSIPHY has been changed on
>>>>> the newer SOCs and it requires generalizing the macro using a new
>>>>> variable 'common_status_offset'. This variable is initialized in the
>>>>> csiphy_init() function.
>>>> "offset" + "common_status_offset" is confusing
>>>>
>>>> Let's maybe add some platform data where we store the actual offset of
>>>> the registers in question and pass a csiphy ptr as an argument
>>>>
>>>> Konrad
>>> Hi Konrad, may be I didn't follow correctly. This is consistent with the way we maintain the other SOC specific reg offsets / data in the CSIPHY driver, in csiphy_device_regs, isn't it? I seem to think it's clearer this way for the reader to see all the offsets at one place. No? Thanks.
>>
>> I thought this driver was a little more complex.. anyway, big
>> changes that will make this prettier are coming so this works too in
>> the meantime
>
> After this short discussion, in order to get it in, can someone
> from Qualcomm ack/r-b it?
>
> Thanks,
> Andi
I'll pick it up per nomal.
---
bod
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-04 0:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 6:25 [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform Hangxiang Ma
2025-12-01 12:20 ` Konrad Dybcio
2025-12-01 14:48 ` Vijay Kumar Tumati
2025-12-01 17:18 ` Konrad Dybcio
2025-12-03 16:57 ` Andi Shyti
2025-12-04 0:19 ` Bryan O'Donoghue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).