• Home
  • Raw
  • Download

Lines Matching refs:sdev

33 	struct spmi_device *sdev = to_spmi_device(dev);  in spmi_dev_release()  local
34 kfree(sdev); in spmi_dev_release()
68 int spmi_device_add(struct spmi_device *sdev) in spmi_device_add() argument
70 struct spmi_controller *ctrl = sdev->ctrl; in spmi_device_add()
73 dev_set_name(&sdev->dev, "%d-%02x", ctrl->nr, sdev->usid); in spmi_device_add()
75 err = device_add(&sdev->dev); in spmi_device_add()
77 dev_err(&sdev->dev, "Can't add %s, status %d\n", in spmi_device_add()
78 dev_name(&sdev->dev), err); in spmi_device_add()
82 dev_dbg(&sdev->dev, "device %s registered\n", dev_name(&sdev->dev)); in spmi_device_add()
93 void spmi_device_remove(struct spmi_device *sdev) in spmi_device_remove() argument
95 device_unregister(&sdev->dev); in spmi_device_remove()
148 int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf) in spmi_register_read() argument
154 return spmi_read_cmd(sdev->ctrl, SPMI_CMD_READ, sdev->usid, addr, in spmi_register_read()
169 int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf, in spmi_ext_register_read() argument
176 return spmi_read_cmd(sdev->ctrl, SPMI_CMD_EXT_READ, sdev->usid, addr, in spmi_ext_register_read()
191 int spmi_ext_register_readl(struct spmi_device *sdev, u16 addr, u8 *buf, in spmi_ext_register_readl() argument
198 return spmi_read_cmd(sdev->ctrl, SPMI_CMD_EXT_READL, sdev->usid, addr, in spmi_ext_register_readl()
211 int spmi_register_write(struct spmi_device *sdev, u8 addr, u8 data) in spmi_register_write() argument
217 return spmi_write_cmd(sdev->ctrl, SPMI_CMD_WRITE, sdev->usid, addr, in spmi_register_write()
229 int spmi_register_zero_write(struct spmi_device *sdev, u8 data) in spmi_register_zero_write() argument
231 return spmi_write_cmd(sdev->ctrl, SPMI_CMD_ZERO_WRITE, sdev->usid, 0, in spmi_register_zero_write()
246 int spmi_ext_register_write(struct spmi_device *sdev, u8 addr, const u8 *buf, in spmi_ext_register_write() argument
253 return spmi_write_cmd(sdev->ctrl, SPMI_CMD_EXT_WRITE, sdev->usid, addr, in spmi_ext_register_write()
268 int spmi_ext_register_writel(struct spmi_device *sdev, u16 addr, const u8 *buf, in spmi_ext_register_writel() argument
275 return spmi_write_cmd(sdev->ctrl, SPMI_CMD_EXT_WRITEL, sdev->usid, in spmi_ext_register_writel()
288 int spmi_command_reset(struct spmi_device *sdev) in spmi_command_reset() argument
290 return spmi_cmd(sdev->ctrl, SPMI_CMD_RESET, sdev->usid); in spmi_command_reset()
300 int spmi_command_sleep(struct spmi_device *sdev) in spmi_command_sleep() argument
302 return spmi_cmd(sdev->ctrl, SPMI_CMD_SLEEP, sdev->usid); in spmi_command_sleep()
313 int spmi_command_wakeup(struct spmi_device *sdev) in spmi_command_wakeup() argument
315 return spmi_cmd(sdev->ctrl, SPMI_CMD_WAKEUP, sdev->usid); in spmi_command_wakeup()
325 int spmi_command_shutdown(struct spmi_device *sdev) in spmi_command_shutdown() argument
327 return spmi_cmd(sdev->ctrl, SPMI_CMD_SHUTDOWN, sdev->usid); in spmi_command_shutdown()
334 struct spmi_device *sdev = to_spmi_device(dev); in spmi_drv_probe() local
341 err = sdrv->probe(sdev); in spmi_drv_probe()
396 struct spmi_device *sdev; in spmi_device_alloc() local
398 sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); in spmi_device_alloc()
399 if (!sdev) in spmi_device_alloc()
402 sdev->ctrl = ctrl; in spmi_device_alloc()
403 device_initialize(&sdev->dev); in spmi_device_alloc()
404 sdev->dev.parent = &ctrl->dev; in spmi_device_alloc()
405 sdev->dev.bus = &spmi_bus_type; in spmi_device_alloc()
406 sdev->dev.type = &spmi_dev_type; in spmi_device_alloc()
407 return sdev; in spmi_device_alloc()
466 struct spmi_device *sdev; in of_spmi_register_devices() local
495 sdev = spmi_device_alloc(ctrl); in of_spmi_register_devices()
496 if (!sdev) in of_spmi_register_devices()
499 sdev->dev.of_node = node; in of_spmi_register_devices()
500 sdev->usid = (u8) reg[0]; in of_spmi_register_devices()
502 err = spmi_device_add(sdev); in of_spmi_register_devices()
504 dev_err(&sdev->dev, in of_spmi_register_devices()
506 spmi_device_put(sdev); in of_spmi_register_devices()