Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/media/platform/qcom/camss/camss-csid-gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static void __csid_configure_rx(struct csid_device *csid,
val = (lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES;
val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
val |= phy->csiphy_id << CSI2_RX_CFG0_PHY_NUM_SEL;
val |= csid->phy.cphy << CSI2_RX_CFG0_PHY_TYPE_SEL;
writel_relaxed(val, csid->base + CSID_CSI2_RX_CFG0);

val = 1 << CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN;
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/platform/qcom/camss/camss-csid-gen3.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#define CSI2_RX_CFG0_VC_MODE 3
#define CSI2_RX_CFG0_DL0_INPUT_SEL 4
#define CSI2_RX_CFG0_PHY_NUM_SEL 20
#define CSI2_RX_CFG0_PHY_TYPE_SEL 24
#define CSI2_RX_CFG0_TPG_MUX_EN BIT(27)
#define CSI2_RX_CFG0_TPG_MUX_SEL GENMASK(29, 28)

Expand Down Expand Up @@ -115,6 +116,7 @@ static void __csid_configure_rx(struct csid_device *csid,

camss = csid->camss;
val = (phy->lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES;
val |= phy->cphy << CSI2_RX_CFG0_PHY_TYPE_SEL;
val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;

if (camss->tpg && csid->tpg_linked &&
Expand Down
10 changes: 6 additions & 4 deletions drivers/media/platform/qcom/camss/camss-csid.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,19 @@ const struct csid_format_info *csid_get_fmt_entry(const struct csid_format_info
* csid_set_clock_rates - Calculate and set clock rates on CSID module
* @csiphy: CSID device
*/
static int csid_set_clock_rates(struct csid_device *csid)
static int csid_set_clock_rates(struct v4l2_subdev *sd, struct csid_device *csid)
{
struct device *dev = csid->camss->dev;
struct csiphy_device *csiphy = &csid->camss->csiphy[csid->phy.csiphy_id];
struct csiphy_lanes_cfg *lane_cfg = &csiphy->cfg.csi2->lane_cfg;
const struct csid_format_info *fmt;
s64 link_freq;
int i, j;
int ret;

fmt = csid_get_fmt_entry(csid->res->formats->formats, csid->res->formats->nformats,
csid->fmt[MSM_CSIPHY_PAD_SINK].code);
link_freq = camss_get_link_freq(&csid->subdev.entity, fmt->bpp,
csid->phy.lane_cnt);
link_freq = camss_get_link_freq(&csid->subdev.entity, fmt->bpp, lane_cfg);
if (link_freq < 0)
link_freq = 0;

Expand Down Expand Up @@ -705,7 +706,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
return ret;
}

ret = csid_set_clock_rates(csid);
ret = csid_set_clock_rates(sd, csid);
if (ret < 0) {
regulator_bulk_disable(csid->num_supplies,
csid->supplies);
Expand Down Expand Up @@ -1290,6 +1291,7 @@ static int csid_link_setup(struct media_entity *entity,
csid->phy.csiphy_id = csiphy->id;

lane_cfg = &csiphy->cfg.csi2->lane_cfg;
csid->phy.cphy = (lane_cfg->phy_cfg == V4L2_MBUS_CSI2_CPHY);
csid->phy.lane_cnt = lane_cfg->num_data;
csid->phy.lane_assign = csid_get_lane_assign(lane_cfg, lane_cfg->num_data);
csid->tpg_linked = false;
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/qcom/camss/camss-csid.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct csid_phy_config {
u32 lane_assign;
u32 en_vc;
u8 need_vc_update;
bool cphy;
};

struct csid_device;
Expand Down
8 changes: 5 additions & 3 deletions drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ static u8 csiphy_settle_cnt_calc(s64 link_freq, u32 timer_clk_rate)
return settle_cnt;
}

static void csiphy_lanes_enable(struct csiphy_device *csiphy,
struct csiphy_config *cfg,
s64 link_freq, u8 lane_mask)
static int csiphy_lanes_enable(struct csiphy_device *csiphy,
struct csiphy_config *cfg,
s64 link_freq, u8 lane_mask)
{
struct csiphy_lanes_cfg *c = &cfg->csi2->lane_cfg;
u8 settle_cnt;
Expand Down Expand Up @@ -132,6 +132,8 @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy,
writel_relaxed(0x3f, csiphy->base +
CAMSS_CSI_PHY_INTERRUPT_CLEARn(l));
}

return 0;
}

static void csiphy_lanes_disable(struct csiphy_device *csiphy,
Expand Down
Loading