Lines Matching refs:rxport
143 #define UB960_SR_INTERRUPT_CTL_IE_RX(n) BIT((n)) /* rxport[n] IRQ */
148 #define UB960_SR_INTERRUPT_STS_IS_RX(n) BIT((n)) /* rxport[n] IRQ */
482 u8 nport; /* RX port number, and index in priv->rxport[] */
532 struct ub960_rxport *rxport;
577 u8 rxport;
665 struct ub960_rxport *rxport;
678 it.rxport = priv->rxports[it.nport];
680 if ((flags & UB960_ITER_ACTIVE_ONLY) && !it.rxport)
684 it.rxport->cdr_mode != RXPORT_CDR_FPD4)
690 it.rxport = NULL;
836 if (priv->reg_current.rxport == nport)
842 dev_err(dev, "%s: cannot select rxport %d (%d)!\n", __func__,
847 priv->reg_current.rxport = nport;
1274 struct ub960_rxport *rxport = priv->rxports[chan_id];
1279 guard(mutex)(&rxport->aliased_addrs_lock);
1281 for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
1282 if (!rxport->aliased_addrs[reg_idx])
1286 if (reg_idx == ARRAY_SIZE(rxport->aliased_addrs)) {
1287 dev_err(dev, "rx%u: alias pool exhausted\n", rxport->nport);
1291 rxport->aliased_addrs[reg_idx] = addr;
1302 rxport->nport, addr, alias, reg_idx);
1311 struct ub960_rxport *rxport = priv->rxports[chan_id];
1316 guard(mutex)(&rxport->aliased_addrs_lock);
1318 for (reg_idx = 0; reg_idx < ARRAY_SIZE(rxport->aliased_addrs); reg_idx++) {
1319 if (rxport->aliased_addrs[reg_idx] == addr)
1323 if (reg_idx == ARRAY_SIZE(rxport->aliased_addrs)) {
1325 rxport->nport, addr);
1329 rxport->aliased_addrs[reg_idx] = 0;
1335 rxport->nport, addr, ret);
1339 dev_dbg(dev, "rx%u: client 0x%02x released at slot %u\n", rxport->nport,
1462 if (!it.rxport->vpoc)
1465 ret = regulator_enable(it.rxport->vpoc);
1476 struct ub960_rxport *rxport = priv->rxports[failed_nport];
1478 if (!rxport || !rxport->vpoc)
1481 regulator_disable(rxport->vpoc);
1490 if (!it.rxport->vpoc)
1493 regulator_disable(it.rxport->vpoc);
1678 struct ub960_rxport *rxport = priv->rxports[nport];
1711 rxport->eq.strobe_pos);
1718 if (rxport->eq.manual_eq) {
1720 rxport->eq.manual.eq_level);
1733 rxport->eq.aeq.eq_level_min,
1734 rxport->eq.aeq.eq_level_max);
1858 struct ub960_rxport *rxport = priv->rxports[nport];
1861 if (!rxport)
1868 if (!ok && rxport->cdr_mode == RXPORT_CDR_FPD4)
1909 struct ub960_rxport *rxport = priv->rxports[nport];
1913 if (!rxport)
1951 struct ub960_rxport *rxport)
1956 switch (rxport->rx_mode) {
1982 struct ub960_rxport *rxport)
1984 switch (rxport->rx_mode) {
2001 static int ub960_rxport_serializer_write(struct ub960_rxport *rxport, u8 reg,
2004 struct ub960_data *priv = rxport->priv;
2014 ret = i2c_smbus_xfer(priv->client->adapter, rxport->ser.alias, 0,
2019 rxport->nport, reg, ret);
2027 static int ub960_rxport_serializer_read(struct ub960_rxport *rxport, u8 reg,
2030 struct ub960_data *priv = rxport->priv;
2038 ret = i2c_smbus_xfer(priv->client->adapter, rxport->ser.alias,
2044 rxport->nport, reg, ret);
2054 static int ub960_serializer_temp_ramp(struct ub960_rxport *rxport)
2056 struct ub960_data *priv = rxport->priv;
2059 u8 nport = rxport->nport;
2064 if (!fwnode_device_is_compatible(rxport->ser.fwnode, "ti,ds90ub953-q1"))
2080 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_CTL,
2084 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_ADDR,
2086 ub960_rxport_serializer_read(rxport, UB953_REG_IND_ACC_DATA,
2096 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_ADDR,
2098 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_DATA,
2102 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_ADDR,
2110 ub960_rxport_serializer_write(rxport, UB953_REG_IND_ACC_DATA,
2117 ub960_rxport_serializer_write(rxport, UB953_REG_RESET_CTL,
2131 static int ub960_rxport_bc_ser_config(struct ub960_rxport *rxport)
2133 struct ub960_data *priv = rxport->priv;
2135 u8 nport = rxport->nport;
2139 if (rxport->ser.addr < 0) {
2164 ub960_rxport_serializer_write(rxport, UB971_ENH_BC_CHK, 0x02, &ret);
2166 ub960_rxport_serializer_write(rxport, UB953_REG_BC_CTRL, 0x06, &ret);
2179 struct ub960_rxport *rxport = priv->rxports[nport];
2181 struct ds90ub9xx_platform_data *ser_pdata = &rxport->ser.pdata;
2183 .fwnode = rxport->ser.fwnode,
2190 ser_pdata->bc_rate = ub960_calc_bc_clk_rate_ub9702(priv, rxport);
2192 ser_pdata->bc_rate = ub960_calc_bc_clk_rate_ub960(priv, rxport);
2199 ser_info.addr = rxport->ser.alias;
2200 rxport->ser.client =
2202 if (IS_ERR(rxport->ser.client)) {
2205 return PTR_ERR(rxport->ser.client);
2209 nport, rxport->ser.client->addr,
2210 rxport->ser.client->adapter->nr, rxport->ser.client->addr);
2217 struct ub960_rxport *rxport = priv->rxports[nport];
2219 i2c_unregister_device(rxport->ser.client);
2220 rxport->ser.client = NULL;
2241 struct ub960_rxport *rxport = priv->rxports[failed_nport];
2243 if (!rxport)
2379 struct ub960_rxport *rxport)
2381 unsigned int nport = rxport->nport;
2396 switch (rxport->rx_mode) {
2419 switch (rxport->rx_mode) {
2452 rxport->lv_fv_pol, &ret);
2465 rxport->ser.alias << 1, &ret);
2485 ret = ub960_init_rx_port_ub960(priv, it.rxport);
2511 ret = ub960_serializer_temp_ramp(it.rxport);
2767 struct ub960_rxport *rxport = priv->rxports[nport];
2770 if (!rxport) {
2779 switch (rxport->cdr_mode) {
2781 switch (rxport->rx_mode) {
2798 rxport->rx_mode);
2804 switch (rxport->rx_mode) {
2823 rxport->rx_mode);
2830 nport, rxport->cdr_mode);
3067 if (it.rxport->ser.addr >= 0) {
3073 it.rxport->ser.addr << 1 |
3080 it.rxport->ser.alias << 1 |
3088 if (fwnode_device_is_compatible(it.rxport->ser.fwnode,
3090 ret = ub960_rxport_bc_ser_config(it.rxport);
3116 if (it.rxport->cdr_mode == RXPORT_CDR_FPD4)
3200 ret = ub960_serializer_temp_ramp(it.rxport);
3489 ret = v4l2_subdev_call(it.rxport->source.sd, pad,
3490 get_frame_desc, it.rxport->source.pad,
3539 struct ub960_rxport *rxport;
3547 rxport = priv->rxports[nport];
3548 if (!rxport)
3560 if (rxport->rx_mode == RXPORT_MODE_CSI2_SYNC ||
3561 rxport->rx_mode == RXPORT_MODE_CSI2_NONSYNC)
3607 switch (it.rxport->rx_mode) {
4195 if (!it.rxport) {
4372 fwnode_handle_put(it.rxport->source.ep_fwnode);
4373 fwnode_handle_put(it.rxport->ser.fwnode);
4375 mutex_destroy(&it.rxport->aliased_addrs_lock);
4377 kfree(it.rxport);
4385 struct ub960_rxport *rxport)
4388 unsigned int nport = rxport->nport;
4416 rxport->cdr_mode = cdr_mode;
4440 rxport->rx_mode = rx_mode;
4445 rxport->eq.manual_eq = false;
4446 rxport->eq.aeq.eq_level_min = UB960_MIN_EQ_LEVEL;
4447 rxport->eq.aeq.eq_level_max = UB960_MAX_EQ_LEVEL;
4466 rxport->eq.strobe_pos = strobe_pos;
4487 rxport->eq.manual_eq = true;
4488 rxport->eq.manual.eq_level = eq_level;
4498 rxport->ser.alias = ser_i2c_alias;
4500 rxport->ser.fwnode = fwnode_get_named_child_node(link_fwnode, "serializer");
4501 if (!rxport->ser.fwnode) {
4506 ret = fwnode_property_read_u32(rxport->ser.fwnode, "reg",
4509 rxport->ser.addr = -EINVAL;
4511 rxport->ser.addr = ser_i2c_addr;
4518 struct ub960_rxport *rxport)
4522 unsigned int nport = rxport->nport;
4527 rxport->source.ep_fwnode = fwnode_graph_get_remote_endpoint(ep_fwnode);
4528 if (!rxport->source.ep_fwnode) {
4535 switch (rxport->rx_mode) {
4555 rxport->lv_fv_pol = (hsync_hi ? UB960_RR_PORT_CONFIG2_LV_POL_LOW : 0) |
4561 fwnode_handle_put(rxport->source.ep_fwnode);
4573 struct ub960_rxport *rxport;
4576 rxport = kzalloc(sizeof(*rxport), GFP_KERNEL);
4577 if (!rxport)
4580 priv->rxports[nport] = rxport;
4582 rxport->nport = nport;
4583 rxport->priv = priv;
4585 ret = ub960_parse_dt_rxport_link_properties(priv, link_fwnode, rxport);
4589 rxport->vpoc = devm_regulator_get_optional(dev, vpoc_names[nport]);
4590 if (IS_ERR(rxport->vpoc)) {
4591 ret = PTR_ERR(rxport->vpoc);
4593 rxport->vpoc = NULL;
4601 ret = ub960_parse_dt_rxport_ep_properties(priv, ep_fwnode, rxport);
4605 mutex_init(&rxport->aliased_addrs_lock);
4610 fwnode_handle_put(rxport->ser.fwnode);
4613 kfree(rxport);
4750 struct ub960_rxport *rxport = to_ub960_asd(asd)->rxport;
4752 u8 nport = rxport->nport;
4756 rxport->source.ep_fwnode,
4763 rxport->source.sd = subdev;
4764 rxport->source.pad = ret;
4766 ret = media_create_pad_link(&rxport->source.sd->entity,
4767 rxport->source.pad, &priv->sd.entity, nport,
4772 rxport->source.sd->name, rxport->source.pad,
4778 if (!it.rxport->source.sd) {
4791 struct ub960_rxport *rxport = to_ub960_asd(asd)->rxport;
4793 rxport->source.sd = NULL;
4812 it.rxport->source.ep_fwnode,
4821 asd->rxport = it.rxport;
5082 priv->reg_current.rxport = 0xff;