Lines Matching full:mfd
3 * STA2x11 mfd for GPIO, SCTL and APBREG
22 #include <linux/mfd/core.h>
23 #include <linux/mfd/sta2x11-mfd.h>
35 /* This describes STA2X11 MFD chip for us, we may have several */
50 struct sta2x11_mfd *mfd; in sta2x11_mfd_find() local
62 list_for_each_entry(mfd, &sta2x11_mfd_list, list) { in sta2x11_mfd_find()
63 if (mfd->instance == instance) in sta2x11_mfd_find()
64 return mfd; in sta2x11_mfd_find()
72 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev); in sta2x11_mfd_add() local
75 if (mfd) in sta2x11_mfd_add()
80 mfd = kzalloc(sizeof(*mfd), flags); in sta2x11_mfd_add()
81 if (!mfd) in sta2x11_mfd_add()
83 INIT_LIST_HEAD(&mfd->list); in sta2x11_mfd_add()
84 for (i = 0; i < ARRAY_SIZE(mfd->lock); i++) in sta2x11_mfd_add()
85 spin_lock_init(&mfd->lock[i]); in sta2x11_mfd_add()
86 mfd->instance = instance; in sta2x11_mfd_add()
87 list_add(&mfd->list, &sta2x11_mfd_list); in sta2x11_mfd_add()
95 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev); in __sta2x11_mfd_mask() local
100 if (!mfd) { in __sta2x11_mfd_mask()
105 regs = mfd->regs[index]; in __sta2x11_mfd_mask()
110 spin_lock_irqsave(&mfd->lock[index], flags); in __sta2x11_mfd_mask()
116 spin_unlock_irqrestore(&mfd->lock[index], flags); in __sta2x11_mfd_mask()
127 struct sta2x11_mfd *mfd; in sta2x11_mfd_get_regs_data() local
131 mfd = sta2x11_mfd_find(pdev); in sta2x11_mfd_get_regs_data()
132 if (!mfd) in sta2x11_mfd_get_regs_data()
136 *regs = mfd->regs[index]; in sta2x11_mfd_get_regs_data()
137 *lock = &mfd->lock[index]; in sta2x11_mfd_get_regs_data()
144 * Special sta2x11-mfd regmap lock/unlock functions
300 struct sta2x11_mfd *mfd; in sta2x11_mfd_platform_probe() local
306 mfd = sta2x11_mfd_find(*pdev); in sta2x11_mfd_platform_probe()
307 if (!mfd) in sta2x11_mfd_platform_probe()
319 mfd->regs[index] = ioremap(res->start, resource_size(res)); in sta2x11_mfd_platform_probe()
320 if (!mfd->regs[index]) { in sta2x11_mfd_platform_probe()
324 regmap_config->lock_arg = &mfd->lock; in sta2x11_mfd_platform_probe()
330 mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index], in sta2x11_mfd_platform_probe()
332 WARN_ON(IS_ERR(mfd->regmap[index])); in sta2x11_mfd_platform_probe()
403 /* Mfd 0 device */
405 /* Mfd 0, Bar 0 */
415 /* Mfd 0 , Bar 1 */
463 /* Mfd 1 devices */
465 /* Mfd 1, Bar 0 */
470 /* Mfd 1, Bar 1 */
527 /* Mfd 0: gpio, sctl, scr, timers / apbregs */
540 /* Mfd 1: vic / apb-soc-regs */
595 /* Just 2 bars for all mfd's at present */ in sta2x11_mfd_probe()
625 .name = "sta2x11-mfd",
640 * But MFD (the pci device) can't be too early. The following choice