Lines Matching refs:rdev

142 	struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev);  in sunxi_rsb_device_probe()  local
148 if (!rdev->irq) { in sunxi_rsb_device_probe()
159 rdev->irq = irq; in sunxi_rsb_device_probe()
166 return drv->probe(rdev); in sunxi_rsb_device_probe()
186 struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev); in sunxi_rsb_dev_release() local
188 kfree(rdev); in sunxi_rsb_dev_release()
202 struct sunxi_rsb_device *rdev; in sunxi_rsb_device_create() local
204 rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); in sunxi_rsb_device_create()
205 if (!rdev) in sunxi_rsb_device_create()
208 rdev->rsb = rsb; in sunxi_rsb_device_create()
209 rdev->hwaddr = hwaddr; in sunxi_rsb_device_create()
210 rdev->rtaddr = rtaddr; in sunxi_rsb_device_create()
211 rdev->dev.bus = &sunxi_rsb_bus; in sunxi_rsb_device_create()
212 rdev->dev.parent = rsb->dev; in sunxi_rsb_device_create()
213 rdev->dev.of_node = node; in sunxi_rsb_device_create()
214 rdev->dev.release = sunxi_rsb_dev_release; in sunxi_rsb_device_create()
216 dev_set_name(&rdev->dev, "%s-%x", RSB_CTRL_NAME, hwaddr); in sunxi_rsb_device_create()
218 err = device_register(&rdev->dev); in sunxi_rsb_device_create()
220 dev_err(&rdev->dev, "Can't add %s, status %d\n", in sunxi_rsb_device_create()
221 dev_name(&rdev->dev), err); in sunxi_rsb_device_create()
225 dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev)); in sunxi_rsb_device_create()
227 return rdev; in sunxi_rsb_device_create()
230 put_device(&rdev->dev); in sunxi_rsb_device_create()
239 static void sunxi_rsb_device_unregister(struct sunxi_rsb_device *rdev) in sunxi_rsb_device_unregister() argument
241 device_unregister(&rdev->dev); in sunxi_rsb_device_unregister()
246 struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev); in sunxi_rsb_remove_devices() local
249 sunxi_rsb_device_unregister(rdev); in sunxi_rsb_remove_devices()
410 struct sunxi_rsb_device *rdev; member
418 struct sunxi_rsb_device *rdev = ctx->rdev; in regmap_sunxi_rsb_reg_read() local
423 return sunxi_rsb_read(rdev->rsb, rdev->rtaddr, reg, val, ctx->size); in regmap_sunxi_rsb_reg_read()
430 struct sunxi_rsb_device *rdev = ctx->rdev; in regmap_sunxi_rsb_reg_write() local
432 return sunxi_rsb_write(rdev->rsb, rdev->rtaddr, reg, &val, ctx->size); in regmap_sunxi_rsb_reg_write()
450 static struct sunxi_rsb_ctx *regmap_sunxi_rsb_init_ctx(struct sunxi_rsb_device *rdev, in regmap_sunxi_rsb_init_ctx() argument
468 ctx->rdev = rdev; in regmap_sunxi_rsb_init_ctx()
474 struct regmap *__devm_regmap_init_sunxi_rsb(struct sunxi_rsb_device *rdev, in __devm_regmap_init_sunxi_rsb() argument
479 struct sunxi_rsb_ctx *ctx = regmap_sunxi_rsb_init_ctx(rdev, config); in __devm_regmap_init_sunxi_rsb()
484 return __devm_regmap_init(&rdev->dev, &regmap_sunxi_rsb, ctx, config, in __devm_regmap_init_sunxi_rsb()
611 struct sunxi_rsb_device *rdev; in of_rsb_register_devices() local
623 rdev = sunxi_rsb_device_create(rsb, child, hwaddr, rtaddr); in of_rsb_register_devices()
624 if (IS_ERR(rdev)) in of_rsb_register_devices()
626 child, PTR_ERR(rdev)); in of_rsb_register_devices()