Lines Matching +full:ctrl +full:- +full:len
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
34 * struct spmi_device - Basic representation of an SPMI device
36 * @ctrl: SPMI controller managing the bus hosting this device.
41 struct spmi_controller *ctrl; member
52 return dev_get_drvdata(&sdev->dev); in spmi_device_get_drvdata()
57 dev_set_drvdata(&sdev->dev, data); in spmi_device_set_drvdata()
60 struct spmi_device *spmi_device_alloc(struct spmi_controller *ctrl);
65 put_device(&sdev->dev); in spmi_device_put()
73 * struct spmi_controller - interface to the SPMI master controller
75 * @nr: board-specific number identifier for this controller/bus
76 * @cmd: sends a non-data command sequence on the SPMI bus.
83 int (*cmd)(struct spmi_controller *ctrl, u8 opcode, u8 sid);
84 int (*read_cmd)(struct spmi_controller *ctrl, u8 opcode,
85 u8 sid, u16 addr, u8 *buf, size_t len);
86 int (*write_cmd)(struct spmi_controller *ctrl, u8 opcode,
87 u8 sid, u16 addr, const u8 *buf, size_t len);
96 void *spmi_controller_get_drvdata(const struct spmi_controller *ctrl) in spmi_controller_get_drvdata() argument
98 return dev_get_drvdata(&ctrl->dev); in spmi_controller_get_drvdata()
101 static inline void spmi_controller_set_drvdata(struct spmi_controller *ctrl, in spmi_controller_set_drvdata() argument
104 dev_set_drvdata(&ctrl->dev, data); in spmi_controller_set_drvdata()
111 * spmi_controller_put() - decrement controller refcount
112 * @ctrl SPMI controller.
114 static inline void spmi_controller_put(struct spmi_controller *ctrl) in spmi_controller_put() argument
116 if (ctrl) in spmi_controller_put()
117 put_device(&ctrl->dev); in spmi_controller_put()
120 int spmi_controller_add(struct spmi_controller *ctrl);
121 void spmi_controller_remove(struct spmi_controller *ctrl);
124 * struct spmi_driver - SPMI slave device driver
154 * spmi_driver_unregister() - unregister an SPMI client driver
160 driver_unregister(&sdrv->driver); in spmi_driver_unregister()
172 size_t len);
174 size_t len);
178 const u8 *buf, size_t len);
180 const u8 *buf, size_t len);