Lines Matching refs:idev

110 static int imr_read(struct imr_device *idev, u32 imr_id, struct imr_regs *imr)  in imr_read()  argument
112 u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base; in imr_read()
141 static int imr_write(struct imr_device *idev, u32 imr_id, struct imr_regs *imr) in imr_write() argument
144 u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base; in imr_write()
192 struct imr_device *idev = s->private; in imr_dbgfs_state_show() local
197 mutex_lock(&idev->lock); in imr_dbgfs_state_show()
199 for (i = 0; i < idev->max_imr; i++) { in imr_dbgfs_state_show()
201 ret = imr_read(idev, i, &imr); in imr_dbgfs_state_show()
226 mutex_unlock(&idev->lock); in imr_dbgfs_state_show()
236 static void imr_debugfs_register(struct imr_device *idev) in imr_debugfs_register() argument
238 debugfs_create_file("imr_state", 0444, NULL, idev, in imr_debugfs_register()
303 struct imr_device *idev = &imr_dev; in imr_add_range() local
309 if (WARN_ONCE(idev->init == false, "driver not initialized")) in imr_add_range()
331 mutex_lock(&idev->lock); in imr_add_range()
340 for (i = 0; i < idev->max_imr; i++) { in imr_add_range()
341 ret = imr_read(idev, i, &imr); in imr_add_range()
372 ret = imr_write(idev, reg, &imr); in imr_add_range()
383 imr_write(idev, reg, &imr); in imr_add_range()
386 mutex_unlock(&idev->lock); in imr_add_range()
412 struct imr_device *idev = &imr_dev; in __imr_remove_range() local
417 if (WARN_ONCE(idev->init == false, "driver not initialized")) in __imr_remove_range()
434 mutex_lock(&idev->lock); in __imr_remove_range()
438 ret = imr_read(idev, reg, &imr); in __imr_remove_range()
449 for (i = 0; i < idev->max_imr; i++) { in __imr_remove_range()
450 ret = imr_read(idev, i, &imr); in __imr_remove_range()
479 ret = imr_write(idev, reg, &imr); in __imr_remove_range()
482 mutex_unlock(&idev->lock); in __imr_remove_range()
537 static void __init imr_fixup_memmap(struct imr_device *idev) in imr_fixup_memmap() argument
546 for (i = 0; i < idev->max_imr; i++) in imr_fixup_memmap()
583 struct imr_device *idev = &imr_dev; in imr_init() local
588 idev->max_imr = QUARK_X1000_IMR_MAX; in imr_init()
589 idev->reg_base = QUARK_X1000_IMR_REGBASE; in imr_init()
590 idev->init = true; in imr_init()
592 mutex_init(&idev->lock); in imr_init()
593 imr_debugfs_register(idev); in imr_init()
594 imr_fixup_memmap(idev); in imr_init()