Lines Matching refs:cal

25 #include "cal.h"
68 u32 val = cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance));
89 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), val);
96 u32 num_lanes = phy->cal->data->camerarx[phy->instance].num_lanes;
178 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance),
184 current_state = cal_read_field(phy->cal,
205 if (cal_read_field(phy->cal,
213 if (cal_read_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance),
225 if (cal_read_field(phy->cal,
232 if (cal_read_field(phy->cal, CAL_CSI2_TIMING(phy->instance),
281 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance),
286 cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)));
304 sscounter = DIV_ROUND_UP(clk_get_rate(phy->cal->fclk), 10000 * 16 * 4);
306 val = cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance));
311 cal_write(phy->cal, CAL_CSI2_TIMING(phy->instance), val);
314 cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance)));
317 cal_write_field(phy->cal, CAL_CSI2_TIMING(phy->instance),
321 cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance)));
373 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance),
379 if (cal_read_field(phy->cal,
388 cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)), i,
445 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(0),
447 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_IRQENABLE(phy->instance),
451 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(0), CAL_HL_IRQ_OCPO_ERR_MASK);
456 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(1), val);
460 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(2), val);
462 cal_write(phy->cal, CAL_CSI2_VC_IRQENABLE(0), 0xFF000000);
470 cal_write(phy->cal, CAL_HL_IRQENABLE_CLR(0),
472 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_IRQENABLE(phy->instance), 0);
477 cal_write(phy->cal, CAL_HL_IRQENABLE_CLR(1), val);
481 cal_write(phy->cal, CAL_HL_IRQENABLE_CLR(2), val);
483 cal_write(phy->cal, CAL_CSI2_VC_IRQENABLE(0), 0);
488 cal_write(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance), BIT(3));
489 cal_write_field(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance),
495 cal_write_field(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance),
499 static int cal_camerarx_regmap_init(struct cal_dev *cal,
505 if (!cal->data)
508 phy_data = &cal->data->camerarx[phy->instance];
512 .reg = cal->syscon_camerrx_offset,
521 phy->fields[i] = devm_regmap_field_alloc(cal->dev,
522 cal->syscon_camerrx,
525 cal_err(cal, "Unable to allocate regmap fields\n");
545 ep_node = of_graph_get_endpoint_by_regs(phy->cal->dev->of_node,
599 struct cal_camerarx *cal_camerarx_create(struct cal_dev *cal,
602 struct platform_device *pdev = to_platform_device(cal->dev);
610 phy->cal = cal;
617 phy->base = devm_ioremap_resource(cal->dev, phy->res);
619 cal_err(cal, "failed to ioremap\n");
624 cal_dbg(1, cal, "ioresource %s at %pa - %pa\n",
627 ret = cal_camerarx_regmap_init(cal, phy);