Lines Matching refs:ch
353 static int pl08x_phy_channel_busy(struct pl08x_phy_chan *ch) in pl08x_phy_channel_busy() argument
357 val = readl(ch->reg_config); in pl08x_phy_channel_busy()
437 static void pl08x_pause_phy_chan(struct pl08x_phy_chan *ch) in pl08x_pause_phy_chan() argument
443 val = readl(ch->reg_config); in pl08x_pause_phy_chan()
445 writel(val, ch->reg_config); in pl08x_pause_phy_chan()
449 if (!pl08x_phy_channel_busy(ch)) in pl08x_pause_phy_chan()
453 if (pl08x_phy_channel_busy(ch)) in pl08x_pause_phy_chan()
454 pr_err("pl08x: channel%u timeout waiting for pause\n", ch->id); in pl08x_pause_phy_chan()
457 static void pl08x_resume_phy_chan(struct pl08x_phy_chan *ch) in pl08x_resume_phy_chan() argument
462 val = readl(ch->reg_config); in pl08x_resume_phy_chan()
464 writel(val, ch->reg_config); in pl08x_resume_phy_chan()
474 struct pl08x_phy_chan *ch) in pl08x_terminate_phy_chan() argument
476 u32 val = readl(ch->reg_config); in pl08x_terminate_phy_chan()
481 writel(val, ch->reg_config); in pl08x_terminate_phy_chan()
483 writel(1 << ch->id, pl08x->base + PL080_ERR_CLEAR); in pl08x_terminate_phy_chan()
484 writel(1 << ch->id, pl08x->base + PL080_TC_CLEAR); in pl08x_terminate_phy_chan()
532 struct pl08x_phy_chan *ch; in pl08x_getbytes_chan() local
539 ch = plchan->phychan; in pl08x_getbytes_chan()
542 if (!ch || !txd) in pl08x_getbytes_chan()
549 clli = readl(ch->base + PL080_CH_LLI) & ~PL080_LLI_LM_AHB2; in pl08x_getbytes_chan()
554 readl(ch->base + PL080_CH_CONTROL), in pl08x_getbytes_chan()
555 readl(ch->base + PL080S_CH_CONTROL2)); in pl08x_getbytes_chan()
557 bytes = get_bytes_in_cctl(readl(ch->base + PL080_CH_CONTROL)); in pl08x_getbytes_chan()
606 struct pl08x_phy_chan *ch = NULL; in pl08x_get_phy_channel() local
611 ch = &pl08x->phy_chans[i]; in pl08x_get_phy_channel()
613 spin_lock_irqsave(&ch->lock, flags); in pl08x_get_phy_channel()
615 if (!ch->locked && !ch->serving) { in pl08x_get_phy_channel()
616 ch->serving = virt_chan; in pl08x_get_phy_channel()
617 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_get_phy_channel()
621 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_get_phy_channel()
629 return ch; in pl08x_get_phy_channel()
634 struct pl08x_phy_chan *ch) in pl08x_put_phy_channel() argument
636 ch->serving = NULL; in pl08x_put_phy_channel()
647 struct pl08x_phy_chan *ch; in pl08x_phy_alloc_and_start() local
649 ch = pl08x_get_phy_channel(pl08x, plchan); in pl08x_phy_alloc_and_start()
650 if (!ch) { in pl08x_phy_alloc_and_start()
657 ch->id, plchan->name); in pl08x_phy_alloc_and_start()
659 plchan->phychan = ch; in pl08x_phy_alloc_and_start()
664 static void pl08x_phy_reassign_start(struct pl08x_phy_chan *ch, in pl08x_phy_reassign_start() argument
670 ch->id, plchan->name); in pl08x_phy_reassign_start()
677 ch->serving = plchan; in pl08x_phy_reassign_start()
678 plchan->phychan = ch; in pl08x_phy_reassign_start()
1967 struct pl08x_phy_chan *ch; in pl08x_debugfs_show() local
1977 ch = &pl08x->phy_chans[i]; in pl08x_debugfs_show()
1979 spin_lock_irqsave(&ch->lock, flags); in pl08x_debugfs_show()
1980 virt_chan = ch->serving; in pl08x_debugfs_show()
1983 ch->id, in pl08x_debugfs_show()
1985 ch->locked ? " LOCKED" : ""); in pl08x_debugfs_show()
1987 spin_unlock_irqrestore(&ch->lock, flags); in pl08x_debugfs_show()
2345 struct pl08x_phy_chan *ch = &pl08x->phy_chans[i]; in pl08x_probe() local
2347 ch->id = i; in pl08x_probe()
2348 ch->base = pl08x->base + PL080_Cx_BASE(i); in pl08x_probe()
2349 ch->reg_config = ch->base + vd->config_offset; in pl08x_probe()
2350 spin_lock_init(&ch->lock); in pl08x_probe()
2360 val = readl(ch->reg_config); in pl08x_probe()
2363 ch->locked = true; in pl08x_probe()
2368 i, pl08x_phy_channel_busy(ch) ? "BUSY" : "FREE"); in pl08x_probe()