Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: camss: csiphy: Make CSIPHY status macro cross-platform

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>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Hangxiang Ma and committed by
Hans Verkuil
26efe43f 94d14ac1

+14 -6
+13 -6
drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
··· 46 46 #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE BIT(7) 47 47 #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B BIT(0) 48 48 #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID BIT(1) 49 - #define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n) ((offset) + 0xb0 + 0x4 * (n)) 49 + #define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, common_status_offset, n) \ 50 + ((offset) + (common_status_offset) + 0x4 * (n)) 50 51 51 52 #define CSIPHY_DEFAULT_PARAMS 0 52 53 #define CSIPHY_LANE_ENABLE 1 ··· 811 810 CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 6)); 812 811 813 812 hw_version = readl_relaxed(csiphy->base + 814 - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 12)); 813 + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 814 + regs->common_status_offset, 12)); 815 815 hw_version |= readl_relaxed(csiphy->base + 816 - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 13)) << 8; 816 + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 817 + regs->common_status_offset, 13)) << 8; 817 818 hw_version |= readl_relaxed(csiphy->base + 818 - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 14)) << 16; 819 + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 820 + regs->common_status_offset, 14)) << 16; 819 821 hw_version |= readl_relaxed(csiphy->base + 820 - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 15)) << 24; 822 + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 823 + regs->common_status_offset, 15)) << 24; 821 824 822 825 dev_dbg(dev, "CSIPHY 3PH HW Version = 0x%08x\n", hw_version); 823 826 } ··· 850 845 for (i = 0; i < 11; i++) { 851 846 int c = i + 22; 852 847 u8 val = readl_relaxed(csiphy->base + 853 - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, i)); 848 + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 849 + regs->common_status_offset, i)); 854 850 855 851 writel_relaxed(val, csiphy->base + 856 852 CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, c)); ··· 1092 1086 1093 1087 csiphy->regs = regs; 1094 1088 regs->offset = 0x800; 1089 + regs->common_status_offset = 0xb0; 1095 1090 1096 1091 switch (csiphy->camss->res->version) { 1097 1092 case CAMSS_845:
+1
drivers/media/platform/qcom/camss/camss-csiphy.h
··· 90 90 const struct csiphy_lane_regs *lane_regs; 91 91 int lane_array_size; 92 92 u32 offset; 93 + u32 common_status_offset; 93 94 }; 94 95 95 96 struct csiphy_device {