History

usb: typec: Separate the operations vector

Introducing struct typec_operations which has the same callbacks as struct typec_capability. The old callbacks are kept for now, but after all users have been converted, they will be removed.

Heikki Krogerus committed 7 years ago

Commit 46310e41 parent 8c127a42 files · +49 −10Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/usb/typec.h+20−0
@@ -168,6 +168,23 @@ struct typec_partner_desc { · 167 unmodified lines
168 struct usb_pd_identity *identity;168 struct usb_pd_identity *identity;
169};169};
170 170
171/**
172 * struct typec_operations - USB Type-C Port Operations
173 * @try_role: Set data role preference for DRP port
174 * @dr_set: Set Data Role
175 * @pr_set: Set Power Role
176 * @vconn_set: Source VCONN
177 * @port_type_set: Set port type
178 */
179struct typec_operations {
180 int (*try_role)(struct typec_port *port, int role);
181 int (*dr_set)(struct typec_port *port, enum typec_data_role role);
182 int (*pr_set)(struct typec_port *port, enum typec_role role);
183 int (*vconn_set)(struct typec_port *port, enum typec_role role);
184 int (*port_type_set)(struct typec_port *port,
185 enum typec_port_type type);
186};
187
171/*188/*
172 * struct typec_capability - USB Type-C Port Capabilities189 * struct typec_capability - USB Type-C Port Capabilities
173 * @type: Supported power role of the port190 * @type: Supported power role of the port
@@ -180,6 +197,7 @@ struct typec_partner_desc { · 6 unmodified lines
180 * @mux: Multiplexer switch for Alternate/Accessory Modes197 * @mux: Multiplexer switch for Alternate/Accessory Modes
181 * @fwnode: Optional fwnode of the port198 * @fwnode: Optional fwnode of the port
182 * @driver_data: Private pointer for driver specific info199 * @driver_data: Private pointer for driver specific info
200 * @ops: Port operations vector
183 * @try_role: Set data role preference for DRP port201 * @try_role: Set data role preference for DRP port
184 * @dr_set: Set Data Role202 * @dr_set: Set Data Role
185 * @pr_set: Set Power Role203 * @pr_set: Set Power Role
@@ -201,6 +219,8 @@ struct typec_capability { · 15 unmodified lines
201 struct fwnode_handle *fwnode;219 struct fwnode_handle *fwnode;
202 void *driver_data;220 void *driver_data;
203 221
222 const struct typec_operations *ops;
223
204 int (*try_role)(const struct typec_capability *,224 int (*try_role)(const struct typec_capability *,
205 int role);225 int role);
206 226

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t