xsdfec 234 drivers/misc/xilinx_sdfec.c static inline void xsdfec_regwrite(struct xsdfec_dev *xsdfec, u32 addr, xsdfec 237 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Writing 0x%x to offset 0x%x", value, addr); xsdfec 238 drivers/misc/xilinx_sdfec.c iowrite32(value, xsdfec->regs + addr); xsdfec 241 drivers/misc/xilinx_sdfec.c static inline u32 xsdfec_regread(struct xsdfec_dev *xsdfec, u32 addr) xsdfec 245 drivers/misc/xilinx_sdfec.c rval = ioread32(xsdfec->regs + addr); xsdfec 246 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Read value = 0x%x from offset 0x%x", rval, addr); xsdfec 250 drivers/misc/xilinx_sdfec.c static void update_bool_config_from_reg(struct xsdfec_dev *xsdfec, xsdfec 257 drivers/misc/xilinx_sdfec.c reg_val = xsdfec_regread(xsdfec, reg_offset); xsdfec 261 drivers/misc/xilinx_sdfec.c static void update_config_from_hw(struct xsdfec_dev *xsdfec) xsdfec 267 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_ORDER_ADDR); xsdfec 268 drivers/misc/xilinx_sdfec.c xsdfec->config.order = reg_value; xsdfec 270 drivers/misc/xilinx_sdfec.c update_bool_config_from_reg(xsdfec, XSDFEC_BYPASS_ADDR, xsdfec 272 drivers/misc/xilinx_sdfec.c &xsdfec->config.bypass); xsdfec 274 drivers/misc/xilinx_sdfec.c update_bool_config_from_reg(xsdfec, XSDFEC_CODE_WR_PROTECT_ADDR, xsdfec 276 drivers/misc/xilinx_sdfec.c &xsdfec->config.code_wr_protect); xsdfec 278 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_IMR_ADDR); xsdfec 279 drivers/misc/xilinx_sdfec.c xsdfec->config.irq.enable_isr = (reg_value & XSDFEC_ISR_MASK) > 0; xsdfec 281 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_ECC_IMR_ADDR); xsdfec 282 drivers/misc/xilinx_sdfec.c xsdfec->config.irq.enable_ecc_isr = xsdfec 285 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_AXIS_ENABLE_ADDR); xsdfec 288 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_STARTED; xsdfec 290 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_STOPPED; xsdfec 293 drivers/misc/xilinx_sdfec.c static int xsdfec_get_status(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 299 drivers/misc/xilinx_sdfec.c spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 300 drivers/misc/xilinx_sdfec.c status.state = xsdfec->state; xsdfec 301 drivers/misc/xilinx_sdfec.c xsdfec->state_updated = false; xsdfec 302 drivers/misc/xilinx_sdfec.c spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 303 drivers/misc/xilinx_sdfec.c status.activity = (xsdfec_regread(xsdfec, XSDFEC_ACTIVE_ADDR) & xsdfec 313 drivers/misc/xilinx_sdfec.c static int xsdfec_get_config(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 317 drivers/misc/xilinx_sdfec.c err = copy_to_user(arg, &xsdfec->config, sizeof(xsdfec->config)); xsdfec 324 drivers/misc/xilinx_sdfec.c static int xsdfec_isr_enable(struct xsdfec_dev *xsdfec, bool enable) xsdfec 330 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_IER_ADDR, XSDFEC_ISR_MASK); xsdfec 331 drivers/misc/xilinx_sdfec.c mask_read = xsdfec_regread(xsdfec, XSDFEC_IMR_ADDR); xsdfec 333 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, xsdfec 339 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_IDR_ADDR, XSDFEC_ISR_MASK); xsdfec 340 drivers/misc/xilinx_sdfec.c mask_read = xsdfec_regread(xsdfec, XSDFEC_IMR_ADDR); xsdfec 342 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, xsdfec 350 drivers/misc/xilinx_sdfec.c static int xsdfec_ecc_isr_enable(struct xsdfec_dev *xsdfec, bool enable) xsdfec 356 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_ECC_IER_ADDR, xsdfec 358 drivers/misc/xilinx_sdfec.c mask_read = xsdfec_regread(xsdfec, XSDFEC_ECC_IMR_ADDR); xsdfec 360 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, xsdfec 366 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_ECC_IDR_ADDR, xsdfec 368 drivers/misc/xilinx_sdfec.c mask_read = xsdfec_regread(xsdfec, XSDFEC_ECC_IMR_ADDR); xsdfec 373 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, xsdfec 381 drivers/misc/xilinx_sdfec.c static int xsdfec_set_irq(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 393 drivers/misc/xilinx_sdfec.c isr_err = xsdfec_isr_enable(xsdfec, irq.enable_isr); xsdfec 395 drivers/misc/xilinx_sdfec.c xsdfec->config.irq.enable_isr = irq.enable_isr; xsdfec 398 drivers/misc/xilinx_sdfec.c ecc_err = xsdfec_ecc_isr_enable(xsdfec, irq.enable_ecc_isr); xsdfec 400 drivers/misc/xilinx_sdfec.c xsdfec->config.irq.enable_ecc_isr = irq.enable_ecc_isr; xsdfec 408 drivers/misc/xilinx_sdfec.c static int xsdfec_set_turbo(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 425 drivers/misc/xilinx_sdfec.c if (xsdfec->config.code == XSDFEC_LDPC_CODE) xsdfec 431 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_TURBO_ADDR, turbo_write); xsdfec 435 drivers/misc/xilinx_sdfec.c static int xsdfec_get_turbo(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 441 drivers/misc/xilinx_sdfec.c if (xsdfec->config.code == XSDFEC_LDPC_CODE) xsdfec 445 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_TURBO_ADDR); xsdfec 458 drivers/misc/xilinx_sdfec.c static int xsdfec_reg0_write(struct xsdfec_dev *xsdfec, u32 n, u32 k, u32 psize, xsdfec 465 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "N value is not in range"); xsdfec 472 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "K value is not in range"); xsdfec 480 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Writing outside of LDPC reg0 space 0x%x", xsdfec 485 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, xsdfec 492 drivers/misc/xilinx_sdfec.c static int xsdfec_reg1_write(struct xsdfec_dev *xsdfec, u32 psize, xsdfec 498 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Psize is not in range"); xsdfec 503 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "No-packing bit register invalid"); xsdfec 508 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "NM is beyond 10 bits"); xsdfec 514 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Writing outside of LDPC reg1 space 0x%x", xsdfec 519 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, xsdfec 526 drivers/misc/xilinx_sdfec.c static int xsdfec_reg2_write(struct xsdfec_dev *xsdfec, u32 nlayers, u32 nmqc, xsdfec 534 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Nlayers is not in range"); xsdfec 539 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "NMQC exceeds 11 bits"); xsdfec 543 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Norm type is invalid"); xsdfec 547 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Special QC in invalid"); xsdfec 552 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "No final parity check invalid"); xsdfec 558 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Max Schedule exceeds 2 bits"); xsdfec 567 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Writing outside of LDPC reg2 space 0x%x", xsdfec 572 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, xsdfec 579 drivers/misc/xilinx_sdfec.c static int xsdfec_reg3_write(struct xsdfec_dev *xsdfec, u8 sc_off, u8 la_off, xsdfec 588 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Writing outside of LDPC reg3 space 0x%x", xsdfec 593 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, xsdfec 600 drivers/misc/xilinx_sdfec.c static int xsdfec_table_write(struct xsdfec_dev *xsdfec, u32 offset, xsdfec 617 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Write exceeds SC table length"); xsdfec 635 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, xsdfec 647 drivers/misc/xilinx_sdfec.c static int xsdfec_add_ldpc(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 661 drivers/misc/xilinx_sdfec.c if (xsdfec->config.code == XSDFEC_TURBO_CODE) { xsdfec 667 drivers/misc/xilinx_sdfec.c if (xsdfec->state == XSDFEC_STARTED) { xsdfec 672 drivers/misc/xilinx_sdfec.c if (xsdfec->config.code_wr_protect) { xsdfec 678 drivers/misc/xilinx_sdfec.c ret = xsdfec_reg0_write(xsdfec, ldpc->n, ldpc->k, ldpc->psize, xsdfec 684 drivers/misc/xilinx_sdfec.c ret = xsdfec_reg1_write(xsdfec, ldpc->psize, ldpc->no_packing, ldpc->nm, xsdfec 690 drivers/misc/xilinx_sdfec.c ret = xsdfec_reg2_write(xsdfec, ldpc->nlayers, ldpc->nmqc, xsdfec 698 drivers/misc/xilinx_sdfec.c ret = xsdfec_reg3_write(xsdfec, ldpc->sc_off, ldpc->la_off, xsdfec 708 drivers/misc/xilinx_sdfec.c ret = xsdfec_table_write(xsdfec, ldpc->sc_off, ldpc->sc_table, n, xsdfec 714 drivers/misc/xilinx_sdfec.c ret = xsdfec_table_write(xsdfec, 4 * ldpc->la_off, ldpc->la_table, xsdfec 720 drivers/misc/xilinx_sdfec.c ret = xsdfec_table_write(xsdfec, 4 * ldpc->qc_off, ldpc->qc_table, xsdfec 730 drivers/misc/xilinx_sdfec.c static int xsdfec_set_order(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 746 drivers/misc/xilinx_sdfec.c if (xsdfec->state == XSDFEC_STARTED) xsdfec 749 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_ORDER_ADDR, order); xsdfec 751 drivers/misc/xilinx_sdfec.c xsdfec->config.order = order; xsdfec 756 drivers/misc/xilinx_sdfec.c static int xsdfec_set_bypass(struct xsdfec_dev *xsdfec, bool __user *arg) xsdfec 766 drivers/misc/xilinx_sdfec.c if (xsdfec->state == XSDFEC_STARTED) xsdfec 770 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_BYPASS_ADDR, 1); xsdfec 772 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_BYPASS_ADDR, 0); xsdfec 774 drivers/misc/xilinx_sdfec.c xsdfec->config.bypass = bypass; xsdfec 779 drivers/misc/xilinx_sdfec.c static int xsdfec_is_active(struct xsdfec_dev *xsdfec, bool __user *arg) xsdfec 785 drivers/misc/xilinx_sdfec.c reg_value = xsdfec_regread(xsdfec, XSDFEC_ACTIVE_ADDR); xsdfec 829 drivers/misc/xilinx_sdfec.c static int xsdfec_cfg_axi_streams(struct xsdfec_dev *xsdfec) xsdfec 836 drivers/misc/xilinx_sdfec.c struct xsdfec_config *config = &xsdfec->config; xsdfec 853 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_AXIS_WIDTH_ADDR, reg_value); xsdfec 868 drivers/misc/xilinx_sdfec.c static int xsdfec_start(struct xsdfec_dev *xsdfec) xsdfec 872 drivers/misc/xilinx_sdfec.c regread = xsdfec_regread(xsdfec, XSDFEC_FEC_CODE_ADDR); xsdfec 874 drivers/misc/xilinx_sdfec.c if (regread != xsdfec->config.code) { xsdfec 875 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, xsdfec 877 drivers/misc/xilinx_sdfec.c __func__, regread, xsdfec->config.code); xsdfec 882 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_AXIS_ENABLE_ADDR, xsdfec 885 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_STARTED; xsdfec 889 drivers/misc/xilinx_sdfec.c static int xsdfec_stop(struct xsdfec_dev *xsdfec) xsdfec 893 drivers/misc/xilinx_sdfec.c if (xsdfec->state != XSDFEC_STARTED) xsdfec 894 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "Device not started correctly"); xsdfec 896 drivers/misc/xilinx_sdfec.c regread = xsdfec_regread(xsdfec, XSDFEC_AXIS_ENABLE_ADDR); xsdfec 898 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_AXIS_ENABLE_ADDR, regread); xsdfec 900 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_STOPPED; xsdfec 904 drivers/misc/xilinx_sdfec.c static int xsdfec_clear_stats(struct xsdfec_dev *xsdfec) xsdfec 906 drivers/misc/xilinx_sdfec.c spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 907 drivers/misc/xilinx_sdfec.c xsdfec->isr_err_count = 0; xsdfec 908 drivers/misc/xilinx_sdfec.c xsdfec->uecc_count = 0; xsdfec 909 drivers/misc/xilinx_sdfec.c xsdfec->cecc_count = 0; xsdfec 910 drivers/misc/xilinx_sdfec.c spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 915 drivers/misc/xilinx_sdfec.c static int xsdfec_get_stats(struct xsdfec_dev *xsdfec, void __user *arg) xsdfec 920 drivers/misc/xilinx_sdfec.c spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 921 drivers/misc/xilinx_sdfec.c user_stats.isr_err_count = xsdfec->isr_err_count; xsdfec 922 drivers/misc/xilinx_sdfec.c user_stats.cecc_count = xsdfec->cecc_count; xsdfec 923 drivers/misc/xilinx_sdfec.c user_stats.uecc_count = xsdfec->uecc_count; xsdfec 924 drivers/misc/xilinx_sdfec.c xsdfec->stats_updated = false; xsdfec 925 drivers/misc/xilinx_sdfec.c spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 934 drivers/misc/xilinx_sdfec.c static int xsdfec_set_default_config(struct xsdfec_dev *xsdfec) xsdfec 937 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_FEC_CODE_ADDR, xsdfec->config.code); xsdfec 938 drivers/misc/xilinx_sdfec.c xsdfec_cfg_axi_streams(xsdfec); xsdfec 939 drivers/misc/xilinx_sdfec.c update_config_from_hw(xsdfec); xsdfec 947 drivers/misc/xilinx_sdfec.c struct xsdfec_dev *xsdfec; xsdfec 951 drivers/misc/xilinx_sdfec.c xsdfec = container_of(fptr->private_data, struct xsdfec_dev, miscdev); xsdfec 954 drivers/misc/xilinx_sdfec.c if (xsdfec->state == XSDFEC_NEEDS_RESET && xsdfec 972 drivers/misc/xilinx_sdfec.c rval = xsdfec_start(xsdfec); xsdfec 975 drivers/misc/xilinx_sdfec.c rval = xsdfec_stop(xsdfec); xsdfec 978 drivers/misc/xilinx_sdfec.c rval = xsdfec_clear_stats(xsdfec); xsdfec 981 drivers/misc/xilinx_sdfec.c rval = xsdfec_get_stats(xsdfec, arg); xsdfec 984 drivers/misc/xilinx_sdfec.c rval = xsdfec_get_status(xsdfec, arg); xsdfec 987 drivers/misc/xilinx_sdfec.c rval = xsdfec_get_config(xsdfec, arg); xsdfec 990 drivers/misc/xilinx_sdfec.c rval = xsdfec_set_default_config(xsdfec); xsdfec 993 drivers/misc/xilinx_sdfec.c rval = xsdfec_set_irq(xsdfec, arg); xsdfec 996 drivers/misc/xilinx_sdfec.c rval = xsdfec_set_turbo(xsdfec, arg); xsdfec 999 drivers/misc/xilinx_sdfec.c rval = xsdfec_get_turbo(xsdfec, arg); xsdfec 1002 drivers/misc/xilinx_sdfec.c rval = xsdfec_add_ldpc(xsdfec, arg); xsdfec 1005 drivers/misc/xilinx_sdfec.c rval = xsdfec_set_order(xsdfec, arg); xsdfec 1008 drivers/misc/xilinx_sdfec.c rval = xsdfec_set_bypass(xsdfec, arg); xsdfec 1011 drivers/misc/xilinx_sdfec.c rval = xsdfec_is_active(xsdfec, (bool __user *)arg); xsdfec 1031 drivers/misc/xilinx_sdfec.c struct xsdfec_dev *xsdfec; xsdfec 1033 drivers/misc/xilinx_sdfec.c xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev); xsdfec 1035 drivers/misc/xilinx_sdfec.c if (!xsdfec) xsdfec 1038 drivers/misc/xilinx_sdfec.c poll_wait(file, &xsdfec->waitq, wait); xsdfec 1041 drivers/misc/xilinx_sdfec.c spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 1042 drivers/misc/xilinx_sdfec.c if (xsdfec->state_updated) xsdfec 1045 drivers/misc/xilinx_sdfec.c if (xsdfec->stats_updated) xsdfec 1047 drivers/misc/xilinx_sdfec.c spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 1063 drivers/misc/xilinx_sdfec.c static int xsdfec_parse_of(struct xsdfec_dev *xsdfec) xsdfec 1065 drivers/misc/xilinx_sdfec.c struct device *dev = xsdfec->dev; xsdfec 1079 drivers/misc/xilinx_sdfec.c xsdfec->config.code = XSDFEC_LDPC_CODE; xsdfec 1081 drivers/misc/xilinx_sdfec.c xsdfec->config.code = XSDFEC_TURBO_CODE; xsdfec 1091 drivers/misc/xilinx_sdfec.c xsdfec->config.din_word_include = din_word_include; xsdfec 1104 drivers/misc/xilinx_sdfec.c xsdfec->config.din_width = din_width; xsdfec 1116 drivers/misc/xilinx_sdfec.c xsdfec->config.dout_word_include = dout_word_include; xsdfec 1129 drivers/misc/xilinx_sdfec.c xsdfec->config.dout_width = dout_width; xsdfec 1136 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_FEC_CODE_ADDR, xsdfec->config.code); xsdfec 1138 drivers/misc/xilinx_sdfec.c xsdfec_cfg_axi_streams(xsdfec); xsdfec 1145 drivers/misc/xilinx_sdfec.c struct xsdfec_dev *xsdfec = dev_id; xsdfec 1155 drivers/misc/xilinx_sdfec.c WARN_ON(xsdfec->irq != irq); xsdfec 1158 drivers/misc/xilinx_sdfec.c xsdfec_isr_enable(xsdfec, false); xsdfec 1159 drivers/misc/xilinx_sdfec.c xsdfec_ecc_isr_enable(xsdfec, false); xsdfec 1161 drivers/misc/xilinx_sdfec.c ecc_err = xsdfec_regread(xsdfec, XSDFEC_ECC_ISR_ADDR); xsdfec 1162 drivers/misc/xilinx_sdfec.c isr_err = xsdfec_regread(xsdfec, XSDFEC_ISR_ADDR); xsdfec 1164 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_ECC_ISR_ADDR, ecc_err); xsdfec 1165 drivers/misc/xilinx_sdfec.c xsdfec_regwrite(xsdfec, XSDFEC_ISR_ADDR, isr_err); xsdfec 1176 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "tmp=%x, uecc=%x, aecc=%x, cecc=%x, isr=%x", tmp, xsdfec 1178 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "uecc=%x, cecc=%x, isr=%x", xsdfec->uecc_count, xsdfec 1179 drivers/misc/xilinx_sdfec.c xsdfec->cecc_count, xsdfec->isr_err_count); xsdfec 1181 drivers/misc/xilinx_sdfec.c spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 1184 drivers/misc/xilinx_sdfec.c xsdfec->uecc_count += uecc_count; xsdfec 1187 drivers/misc/xilinx_sdfec.c xsdfec->cecc_count += cecc_count; xsdfec 1190 drivers/misc/xilinx_sdfec.c xsdfec->isr_err_count += isr_err_count; xsdfec 1195 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_NEEDS_RESET; xsdfec 1197 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_PL_RECONFIGURE; xsdfec 1198 drivers/misc/xilinx_sdfec.c xsdfec->stats_updated = true; xsdfec 1199 drivers/misc/xilinx_sdfec.c xsdfec->state_updated = true; xsdfec 1203 drivers/misc/xilinx_sdfec.c xsdfec->stats_updated = true; xsdfec 1206 drivers/misc/xilinx_sdfec.c xsdfec->state = XSDFEC_NEEDS_RESET; xsdfec 1207 drivers/misc/xilinx_sdfec.c xsdfec->stats_updated = true; xsdfec 1208 drivers/misc/xilinx_sdfec.c xsdfec->state_updated = true; xsdfec 1211 drivers/misc/xilinx_sdfec.c spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); xsdfec 1212 drivers/misc/xilinx_sdfec.c dev_dbg(xsdfec->dev, "state=%x, stats=%x", xsdfec->state_updated, xsdfec 1213 drivers/misc/xilinx_sdfec.c xsdfec->stats_updated); xsdfec 1216 drivers/misc/xilinx_sdfec.c if (xsdfec->state_updated || xsdfec->stats_updated) xsdfec 1217 drivers/misc/xilinx_sdfec.c wake_up_interruptible(&xsdfec->waitq); xsdfec 1222 drivers/misc/xilinx_sdfec.c xsdfec_isr_enable(xsdfec, true); xsdfec 1223 drivers/misc/xilinx_sdfec.c xsdfec_ecc_isr_enable(xsdfec, true); xsdfec 1383 drivers/misc/xilinx_sdfec.c struct xsdfec_dev *xsdfec; xsdfec 1389 drivers/misc/xilinx_sdfec.c xsdfec = devm_kzalloc(&pdev->dev, sizeof(*xsdfec), GFP_KERNEL); xsdfec 1390 drivers/misc/xilinx_sdfec.c if (!xsdfec) xsdfec 1393 drivers/misc/xilinx_sdfec.c xsdfec->dev = &pdev->dev; xsdfec 1394 drivers/misc/xilinx_sdfec.c spin_lock_init(&xsdfec->error_data_lock); xsdfec 1396 drivers/misc/xilinx_sdfec.c err = xsdfec_clk_init(pdev, &xsdfec->clks); xsdfec 1400 drivers/misc/xilinx_sdfec.c dev = xsdfec->dev; xsdfec 1402 drivers/misc/xilinx_sdfec.c xsdfec->regs = devm_ioremap_resource(dev, res); xsdfec 1403 drivers/misc/xilinx_sdfec.c if (IS_ERR(xsdfec->regs)) { xsdfec 1404 drivers/misc/xilinx_sdfec.c err = PTR_ERR(xsdfec->regs); xsdfec 1408 drivers/misc/xilinx_sdfec.c xsdfec->irq = platform_get_irq(pdev, 0); xsdfec 1409 drivers/misc/xilinx_sdfec.c if (xsdfec->irq < 0) { xsdfec 1414 drivers/misc/xilinx_sdfec.c err = xsdfec_parse_of(xsdfec); xsdfec 1418 drivers/misc/xilinx_sdfec.c update_config_from_hw(xsdfec); xsdfec 1421 drivers/misc/xilinx_sdfec.c platform_set_drvdata(pdev, xsdfec); xsdfec 1424 drivers/misc/xilinx_sdfec.c init_waitqueue_head(&xsdfec->waitq); xsdfec 1426 drivers/misc/xilinx_sdfec.c err = devm_request_threaded_irq(dev, xsdfec->irq, NULL, xsdfec 1428 drivers/misc/xilinx_sdfec.c "xilinx-sdfec16", xsdfec); xsdfec 1430 drivers/misc/xilinx_sdfec.c dev_err(dev, "unable to request IRQ%d", xsdfec->irq); xsdfec 1438 drivers/misc/xilinx_sdfec.c xsdfec->dev_id = err; xsdfec 1440 drivers/misc/xilinx_sdfec.c snprintf(xsdfec->dev_name, DEV_NAME_LEN, "xsdfec%d", xsdfec->dev_id); xsdfec 1441 drivers/misc/xilinx_sdfec.c xsdfec->miscdev.minor = MISC_DYNAMIC_MINOR; xsdfec 1442 drivers/misc/xilinx_sdfec.c xsdfec->miscdev.name = xsdfec->dev_name; xsdfec 1443 drivers/misc/xilinx_sdfec.c xsdfec->miscdev.fops = &xsdfec_fops; xsdfec 1444 drivers/misc/xilinx_sdfec.c xsdfec->miscdev.parent = dev; xsdfec 1445 drivers/misc/xilinx_sdfec.c err = misc_register(&xsdfec->miscdev); xsdfec 1453 drivers/misc/xilinx_sdfec.c ida_free(&dev_nrs, xsdfec->dev_id); xsdfec 1455 drivers/misc/xilinx_sdfec.c xsdfec_disable_all_clks(&xsdfec->clks); xsdfec 1461 drivers/misc/xilinx_sdfec.c struct xsdfec_dev *xsdfec; xsdfec 1463 drivers/misc/xilinx_sdfec.c xsdfec = platform_get_drvdata(pdev); xsdfec 1464 drivers/misc/xilinx_sdfec.c misc_deregister(&xsdfec->miscdev); xsdfec 1465 drivers/misc/xilinx_sdfec.c ida_free(&dev_nrs, xsdfec->dev_id); xsdfec 1466 drivers/misc/xilinx_sdfec.c xsdfec_disable_all_clks(&xsdfec->clks);