Lines Matching refs:cal
76 u32 val = cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)); in cal_camerarx_lane_config()
97 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), val); in cal_camerarx_lane_config()
104 u32 num_lanes = phy->cal->data->camerarx[phy->instance].num_lanes; in cal_camerarx_enable()
170 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_power()
176 current_state = cal_read_field(phy->cal, in cal_camerarx_power()
197 if (cal_read_field(phy->cal, in cal_camerarx_wait_reset()
205 if (cal_read_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_wait_reset()
217 if (cal_read_field(phy->cal, in cal_camerarx_wait_stop_state()
224 if (cal_read_field(phy->cal, CAL_CSI2_TIMING(phy->instance), in cal_camerarx_wait_stop_state()
247 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(0), in cal_camerarx_enable_irqs()
250 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_IRQENABLE(phy->instance), in cal_camerarx_enable_irqs()
252 cal_write(phy->cal, CAL_CSI2_VC_IRQENABLE(phy->instance), in cal_camerarx_enable_irqs()
259 cal_write(phy->cal, CAL_HL_IRQENABLE_CLR(0), in cal_camerarx_disable_irqs()
262 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_IRQENABLE(phy->instance), 0); in cal_camerarx_disable_irqs()
263 cal_write(phy->cal, CAL_CSI2_VC_IRQENABLE(phy->instance), 0); in cal_camerarx_disable_irqs()
268 cal_write_field(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance), in cal_camerarx_ppi_enable()
271 cal_write_field(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance), in cal_camerarx_ppi_enable()
277 cal_write_field(phy->cal, CAL_CSI2_PPI_CTRL(phy->instance), in cal_camerarx_ppi_disable()
332 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_start()
337 cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance))); in cal_camerarx_start()
355 sscounter = DIV_ROUND_UP(clk_get_rate(phy->cal->fclk), 10000 * 16 * 4); in cal_camerarx_start()
357 val = cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance)); in cal_camerarx_start()
362 cal_write(phy->cal, CAL_CSI2_TIMING(phy->instance), val); in cal_camerarx_start()
365 cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance))); in cal_camerarx_start()
368 cal_write_field(phy->cal, CAL_CSI2_TIMING(phy->instance), in cal_camerarx_start()
372 cal_read(phy->cal, CAL_CSI2_TIMING(phy->instance))); in cal_camerarx_start()
436 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_stop()
442 cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance))); in cal_camerarx_stop()
484 static int cal_camerarx_regmap_init(struct cal_dev *cal, in cal_camerarx_regmap_init() argument
490 if (!cal->data) in cal_camerarx_regmap_init()
493 phy_data = &cal->data->camerarx[phy->instance]; in cal_camerarx_regmap_init()
497 .reg = cal->syscon_camerrx_offset, in cal_camerarx_regmap_init()
506 phy->fields[i] = devm_regmap_field_alloc(cal->dev, in cal_camerarx_regmap_init()
507 cal->syscon_camerrx, in cal_camerarx_regmap_init()
510 cal_err(cal, "Unable to allocate regmap fields\n"); in cal_camerarx_regmap_init()
530 ep_node = of_graph_get_endpoint_by_regs(phy->cal->dev->of_node, in cal_camerarx_parse_dt()
831 struct cal_camerarx *cal_camerarx_create(struct cal_dev *cal, in cal_camerarx_create() argument
834 struct platform_device *pdev = to_platform_device(cal->dev); in cal_camerarx_create()
844 phy->cal = cal; in cal_camerarx_create()
853 phy->base = devm_ioremap_resource(cal->dev, phy->res); in cal_camerarx_create()
855 cal_err(cal, "failed to ioremap\n"); in cal_camerarx_create()
860 cal_dbg(1, cal, "ioresource %s at %pa - %pa\n", in cal_camerarx_create()
863 ret = cal_camerarx_regmap_init(cal, phy); in cal_camerarx_create()
877 sd->dev = cal->dev; in cal_camerarx_create()
892 ret = v4l2_device_register_subdev(&cal->v4l2_dev, sd); in cal_camerarx_create()