Lines Matching refs:mfd
3 * STA2x11 mfd for GPIO, SCTL and APBREG
22 #include <linux/mfd/core.h>
23 #include <linux/mfd/sta2x11-mfd.h>
50 struct sta2x11_mfd *mfd;
62 list_for_each_entry(mfd, &sta2x11_mfd_list, list) {
63 if (mfd->instance == instance)
64 return mfd;
72 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev);
75 if (mfd)
80 mfd = kzalloc(sizeof(*mfd), flags);
81 if (!mfd)
83 INIT_LIST_HEAD(&mfd->list);
84 for (i = 0; i < ARRAY_SIZE(mfd->lock); i++)
85 spin_lock_init(&mfd->lock[i]);
86 mfd->instance = instance;
87 list_add(&mfd->list, &sta2x11_mfd_list);
95 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev);
100 if (!mfd) {
105 regs = mfd->regs[index];
110 spin_lock_irqsave(&mfd->lock[index], flags);
116 spin_unlock_irqrestore(&mfd->lock[index], flags);
127 struct sta2x11_mfd *mfd;
131 mfd = sta2x11_mfd_find(pdev);
132 if (!mfd)
136 *regs = mfd->regs[index];
137 *lock = &mfd->lock[index];
144 * Special sta2x11-mfd regmap lock/unlock functions
300 struct sta2x11_mfd *mfd;
306 mfd = sta2x11_mfd_find(*pdev);
307 if (!mfd)
319 mfd->regs[index] = ioremap(res->start, resource_size(res));
320 if (!mfd->regs[index]) {
324 regmap_config->lock_arg = &mfd->lock;
330 mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index],
332 WARN_ON(IS_ERR(mfd->regmap[index]));
595 /* Just 2 bars for all mfd's at present */
625 .name = "sta2x11-mfd",