Lines Matching refs:ch

351 static int pl08x_phy_channel_busy(struct pl08x_phy_chan *ch)  in pl08x_phy_channel_busy()  argument
355 val = readl(ch->reg_config); in pl08x_phy_channel_busy()
435 static void pl08x_pause_phy_chan(struct pl08x_phy_chan *ch) in pl08x_pause_phy_chan() argument
441 val = readl(ch->reg_config); in pl08x_pause_phy_chan()
443 writel(val, ch->reg_config); in pl08x_pause_phy_chan()
447 if (!pl08x_phy_channel_busy(ch)) in pl08x_pause_phy_chan()
451 if (pl08x_phy_channel_busy(ch)) in pl08x_pause_phy_chan()
452 pr_err("pl08x: channel%u timeout waiting for pause\n", ch->id); in pl08x_pause_phy_chan()
455 static void pl08x_resume_phy_chan(struct pl08x_phy_chan *ch) in pl08x_resume_phy_chan() argument
460 val = readl(ch->reg_config); in pl08x_resume_phy_chan()
462 writel(val, ch->reg_config); in pl08x_resume_phy_chan()
472 struct pl08x_phy_chan *ch) in pl08x_terminate_phy_chan() argument
474 u32 val = readl(ch->reg_config); in pl08x_terminate_phy_chan()
479 writel(val, ch->reg_config); in pl08x_terminate_phy_chan()
481 writel(1 << ch->id, pl08x->base + PL080_ERR_CLEAR); in pl08x_terminate_phy_chan()
482 writel(1 << ch->id, pl08x->base + PL080_TC_CLEAR); in pl08x_terminate_phy_chan()
530 struct pl08x_phy_chan *ch; in pl08x_getbytes_chan() local
537 ch = plchan->phychan; in pl08x_getbytes_chan()
540 if (!ch || !txd) in pl08x_getbytes_chan()
547 clli = readl(ch->base + PL080_CH_LLI) & ~PL080_LLI_LM_AHB2; in pl08x_getbytes_chan()
552 readl(ch->base + PL080_CH_CONTROL), in pl08x_getbytes_chan()
553 readl(ch->base + PL080S_CH_CONTROL2)); in pl08x_getbytes_chan()
555 bytes = get_bytes_in_cctl(readl(ch->base + PL080_CH_CONTROL)); in pl08x_getbytes_chan()
604 struct pl08x_phy_chan *ch = NULL; in pl08x_get_phy_channel() local
609 ch = &pl08x->phy_chans[i]; in pl08x_get_phy_channel()
611 spin_lock_irqsave(&ch->lock, flags); in pl08x_get_phy_channel()
613 if (!ch->locked && !ch->serving) { in pl08x_get_phy_channel()
614 ch->serving = virt_chan; in pl08x_get_phy_channel()
615 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_get_phy_channel()
619 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_get_phy_channel()
627 return ch; in pl08x_get_phy_channel()
632 struct pl08x_phy_chan *ch) in pl08x_put_phy_channel() argument
634 ch->serving = NULL; in pl08x_put_phy_channel()
645 struct pl08x_phy_chan *ch; in pl08x_phy_alloc_and_start() local
647 ch = pl08x_get_phy_channel(pl08x, plchan); in pl08x_phy_alloc_and_start()
648 if (!ch) { in pl08x_phy_alloc_and_start()
655 ch->id, plchan->name); in pl08x_phy_alloc_and_start()
657 plchan->phychan = ch; in pl08x_phy_alloc_and_start()
662 static void pl08x_phy_reassign_start(struct pl08x_phy_chan *ch, in pl08x_phy_reassign_start() argument
668 ch->id, plchan->name); in pl08x_phy_reassign_start()
675 ch->serving = plchan; in pl08x_phy_reassign_start()
676 plchan->phychan = ch; in pl08x_phy_reassign_start()
1965 struct pl08x_phy_chan *ch; in pl08x_debugfs_show() local
1975 ch = &pl08x->phy_chans[i]; in pl08x_debugfs_show()
1977 spin_lock_irqsave(&ch->lock, flags); in pl08x_debugfs_show()
1978 virt_chan = ch->serving; in pl08x_debugfs_show()
1981 ch->id, in pl08x_debugfs_show()
1983 ch->locked ? " LOCKED" : ""); in pl08x_debugfs_show()
1985 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_debugfs_show()
2159 struct pl08x_phy_chan *ch = &pl08x->phy_chans[i]; in pl08x_probe() local
2161 ch->id = i; in pl08x_probe()
2162 ch->base = pl08x->base + PL080_Cx_BASE(i); in pl08x_probe()
2163 ch->reg_config = ch->base + vd->config_offset; in pl08x_probe()
2164 spin_lock_init(&ch->lock); in pl08x_probe()
2174 val = readl(ch->reg_config); in pl08x_probe()
2177 ch->locked = true; in pl08x_probe()
2182 i, pl08x_phy_channel_busy(ch) ? "BUSY" : "FREE"); in pl08x_probe()