Lines Matching refs:pw

376 	out_be32(&pw->pw_regs->pwsr, IPWSR_CLEAR);  in msg_unit_error_handler()
391 struct fsl_rio_pw *pw = (struct fsl_rio_pw *)dev_instance; in fsl_rio_port_write_handler() local
398 ipwmr = in_be32(&pw->pw_regs->pwmr); in fsl_rio_port_write_handler()
399 ipwsr = in_be32(&pw->pw_regs->pwsr); in fsl_rio_port_write_handler()
420 if (kfifo_avail(&pw->pw_fifo) >= RIO_PW_MSG_SIZE) { in fsl_rio_port_write_handler()
421 pw->port_write_msg.msg_count++; in fsl_rio_port_write_handler()
422 kfifo_in(&pw->pw_fifo, pw->port_write_msg.virt, in fsl_rio_port_write_handler()
425 pw->port_write_msg.discard_count++; in fsl_rio_port_write_handler()
427 pw->port_write_msg.discard_count); in fsl_rio_port_write_handler()
432 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_QFI); in fsl_rio_port_write_handler()
433 out_be32(&pw->pw_regs->pwmr, ipwmr | RIO_IPWMR_CQ); in fsl_rio_port_write_handler()
435 schedule_work(&pw->pw_work); in fsl_rio_port_write_handler()
439 pw->port_write_msg.err_count++; in fsl_rio_port_write_handler()
441 pw->port_write_msg.err_count); in fsl_rio_port_write_handler()
445 out_be32(&pw->pw_regs->pwmr, ipwmr & ~RIO_IPWMR_PWE); in fsl_rio_port_write_handler()
446 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_TE); in fsl_rio_port_write_handler()
447 out_be32(&pw->pw_regs->pwmr, ipwmr); in fsl_rio_port_write_handler()
451 pw->port_write_msg.discard_count++; in fsl_rio_port_write_handler()
453 pw->port_write_msg.discard_count); in fsl_rio_port_write_handler()
454 out_be32(&pw->pw_regs->pwsr, RIO_IPWSR_PWD); in fsl_rio_port_write_handler()
481 struct fsl_rio_pw *pw = container_of(work, struct fsl_rio_pw, pw_work); in fsl_pw_dpc() local
488 while (kfifo_out_spinlocked(&pw->pw_fifo, (unsigned char *)&msg_buffer, in fsl_pw_dpc()
489 RIO_PW_MSG_SIZE, &pw->pw_fifo_lock)) { in fsl_pw_dpc()
506 if (pw->mport[i]) in fsl_pw_dpc()
507 rio_inb_pwrite_handler(pw->mport[i], in fsl_pw_dpc()
522 rval = in_be32(&pw->pw_regs->pwmr); in fsl_rio_pw_enable()
529 out_be32(&pw->pw_regs->pwmr, rval); in fsl_rio_pw_enable()
543 int fsl_rio_port_write_init(struct fsl_rio_pw *pw) in fsl_rio_port_write_init() argument
548 out_be32(&pw->pw_regs->pwmr, in fsl_rio_port_write_init()
549 in_be32(&pw->pw_regs->pwmr) & ~RIO_IPWMR_PWE); in fsl_rio_port_write_init()
552 pw->port_write_msg.virt = dma_alloc_coherent(pw->dev, in fsl_rio_port_write_init()
554 &pw->port_write_msg.phys, GFP_KERNEL); in fsl_rio_port_write_init()
555 if (!pw->port_write_msg.virt) { in fsl_rio_port_write_init()
560 pw->port_write_msg.err_count = 0; in fsl_rio_port_write_init()
561 pw->port_write_msg.discard_count = 0; in fsl_rio_port_write_init()
564 out_be32(&pw->pw_regs->epwqbar, 0); in fsl_rio_port_write_init()
565 out_be32(&pw->pw_regs->pwqbar, (u32) pw->port_write_msg.phys); in fsl_rio_port_write_init()
568 in_be32(&pw->pw_regs->epwqbar), in fsl_rio_port_write_init()
569 in_be32(&pw->pw_regs->pwqbar)); in fsl_rio_port_write_init()
572 out_be32(&pw->pw_regs->pwsr, in fsl_rio_port_write_init()
577 out_be32(&pw->pw_regs->pwmr, in fsl_rio_port_write_init()
582 rc = request_irq(IRQ_RIO_PW(pw), fsl_rio_port_write_handler, in fsl_rio_port_write_init()
583 IRQF_SHARED, "port-write", (void *)pw); in fsl_rio_port_write_init()
591 INIT_WORK(&pw->pw_work, fsl_pw_dpc); in fsl_rio_port_write_init()
592 spin_lock_init(&pw->pw_fifo_lock); in fsl_rio_port_write_init()
593 if (kfifo_alloc(&pw->pw_fifo, RIO_PW_MSG_SIZE * 32, GFP_KERNEL)) { in fsl_rio_port_write_init()
600 in_be32(&pw->pw_regs->pwmr), in fsl_rio_port_write_init()
601 in_be32(&pw->pw_regs->pwsr)); in fsl_rio_port_write_init()
606 free_irq(IRQ_RIO_PW(pw), (void *)pw); in fsl_rio_port_write_init()
608 dma_free_coherent(pw->dev, RIO_PW_MSG_SIZE, in fsl_rio_port_write_init()
609 pw->port_write_msg.virt, in fsl_rio_port_write_init()
610 pw->port_write_msg.phys); in fsl_rio_port_write_init()