Lines Matching refs:xtmr_manager
60 static inline void xtmr_manager_write(struct xtmr_manager_dev *xtmr_manager, in xtmr_manager_write() argument
63 iowrite32(value, xtmr_manager->regs + addr); in xtmr_manager_write()
66 static inline u32 xtmr_manager_read(struct xtmr_manager_dev *xtmr_manager, in xtmr_manager_read() argument
69 return ioread32(xtmr_manager->regs + addr); in xtmr_manager_read()
72 static void xmb_manager_reset_handler(struct xtmr_manager_dev *xtmr_manager) in xmb_manager_reset_handler() argument
75 xtmr_manager_write(xtmr_manager, XTMR_MANAGER_FFR_OFFSET, 0); in xmb_manager_reset_handler()
78 static void xmb_manager_update_errcnt(struct xtmr_manager_dev *xtmr_manager) in xmb_manager_update_errcnt() argument
80 xtmr_manager->err_cnt++; in xmb_manager_update_errcnt()
86 struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); in errcnt_show() local
88 return sysfs_emit(buf, "%x\n", xtmr_manager->err_cnt); in errcnt_show()
96 struct xtmr_manager_dev *xtmr_manager = dev_get_drvdata(dev); in dis_block_break_store() local
105 xtmr_manager->cr_val &= ~(1 << XTMR_MANAGER_CR_BB_SHIFT); in dis_block_break_store()
106 xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, in dis_block_break_store()
107 xtmr_manager->cr_val); in dis_block_break_store()
119 static void xtmr_manager_init(struct xtmr_manager_dev *xtmr_manager) in xtmr_manager_init() argument
122 xtmr_manager_write(xtmr_manager, XTMR_MANAGER_SEMIMR_OFFSET, 0); in xtmr_manager_init()
125 xtmr_manager->cr_val = (1 << XTMR_MANAGER_CR_RIR_SHIFT) | in xtmr_manager_init()
126 xtmr_manager->magic1; in xtmr_manager_init()
127 xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, in xtmr_manager_init()
128 xtmr_manager->cr_val); in xtmr_manager_init()
133 xtmr_manager_write(xtmr_manager, XTMR_MANAGER_BDIR_OFFSET, 0); in xtmr_manager_init()
139 xtmr_manager->cr_val |= (1 << XTMR_MANAGER_CR_BB_SHIFT); in xtmr_manager_init()
149 xmb_manager_register(xtmr_manager->phys_baseaddr, xtmr_manager->cr_val, in xtmr_manager_init()
151 xtmr_manager, (void *)xmb_manager_reset_handler); in xtmr_manager_init()
165 struct xtmr_manager_dev *xtmr_manager; in xtmr_manager_probe() local
169 xtmr_manager = devm_kzalloc(&pdev->dev, sizeof(*xtmr_manager), in xtmr_manager_probe()
171 if (!xtmr_manager) in xtmr_manager_probe()
174 xtmr_manager->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in xtmr_manager_probe()
175 if (IS_ERR(xtmr_manager->regs)) in xtmr_manager_probe()
176 return PTR_ERR(xtmr_manager->regs); in xtmr_manager_probe()
178 xtmr_manager->phys_baseaddr = res->start; in xtmr_manager_probe()
181 &xtmr_manager->magic1); in xtmr_manager_probe()
187 if (xtmr_manager->magic1 > XTMR_MANAGER_MAGIC1_MAX_VAL) { in xtmr_manager_probe()
193 xtmr_manager_init(xtmr_manager); in xtmr_manager_probe()
195 platform_set_drvdata(pdev, xtmr_manager); in xtmr_manager_probe()