diff options
author | Hans de Goede <hdegoede@redhat.com> | 2018-03-20 08:57:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-22 08:49:28 -0400 |
commit | 29b4aec2f407341963b7e3b15e8756ce815abf8a (patch) | |
tree | b46027162215de8c570468d02992d223b4b9f624 | |
parent | da95cc1d9a4c7a5f0add7372527074321981bd98 (diff) |
platform/x86: intel_cht_int33fe: Add device connections for the Type-C port
We need to add device-connections for the Type-C mux/switch and usb-role
code to be able to find the PI3USB30532 Type-C cross-switch and the
device/host role-switch integrated in the CHT SoC.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/platform/x86/intel_cht_int33fe.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_cht_int33fe.c b/drivers/platform/x86/intel_cht_int33fe.c index 380ef7ec094f..39d4100c60a2 100644 --- a/drivers/platform/x86/intel_cht_int33fe.c +++ b/drivers/platform/x86/intel_cht_int33fe.c | |||
@@ -33,6 +33,8 @@ struct cht_int33fe_data { | |||
33 | struct i2c_client *max17047; | 33 | struct i2c_client *max17047; |
34 | struct i2c_client *fusb302; | 34 | struct i2c_client *fusb302; |
35 | struct i2c_client *pi3usb30532; | 35 | struct i2c_client *pi3usb30532; |
36 | /* Contain a list-head must be per device */ | ||
37 | struct device_connection connections[3]; | ||
36 | }; | 38 | }; |
37 | 39 | ||
38 | /* | 40 | /* |
@@ -172,6 +174,20 @@ static int cht_int33fe_probe(struct i2c_client *client) | |||
172 | return -EPROBE_DEFER; /* Wait for i2c-adapter to load */ | 174 | return -EPROBE_DEFER; /* Wait for i2c-adapter to load */ |
173 | } | 175 | } |
174 | 176 | ||
177 | data->connections[0].endpoint[0] = "i2c-fusb302"; | ||
178 | data->connections[0].endpoint[1] = "i2c-pi3usb30532"; | ||
179 | data->connections[0].id = "typec-switch"; | ||
180 | data->connections[1].endpoint[0] = "i2c-fusb302"; | ||
181 | data->connections[1].endpoint[1] = "i2c-pi3usb30532"; | ||
182 | data->connections[1].id = "typec-mux"; | ||
183 | data->connections[2].endpoint[0] = "i2c-fusb302"; | ||
184 | data->connections[2].endpoint[1] = "intel_xhci_usb_sw-role-switch"; | ||
185 | data->connections[2].id = "usb-role-switch"; | ||
186 | |||
187 | device_connection_add(&data->connections[0]); | ||
188 | device_connection_add(&data->connections[1]); | ||
189 | device_connection_add(&data->connections[2]); | ||
190 | |||
175 | memset(&board_info, 0, sizeof(board_info)); | 191 | memset(&board_info, 0, sizeof(board_info)); |
176 | strlcpy(board_info.type, "typec_fusb302", I2C_NAME_SIZE); | 192 | strlcpy(board_info.type, "typec_fusb302", I2C_NAME_SIZE); |
177 | board_info.dev_name = "fusb302"; | 193 | board_info.dev_name = "fusb302"; |
@@ -201,6 +217,10 @@ out_unregister_max17047: | |||
201 | if (data->max17047) | 217 | if (data->max17047) |
202 | i2c_unregister_device(data->max17047); | 218 | i2c_unregister_device(data->max17047); |
203 | 219 | ||
220 | device_connection_remove(&data->connections[2]); | ||
221 | device_connection_remove(&data->connections[1]); | ||
222 | device_connection_remove(&data->connections[0]); | ||
223 | |||
204 | return -EPROBE_DEFER; /* Wait for the i2c-adapter to load */ | 224 | return -EPROBE_DEFER; /* Wait for the i2c-adapter to load */ |
205 | } | 225 | } |
206 | 226 | ||
@@ -213,6 +233,10 @@ static int cht_int33fe_remove(struct i2c_client *i2c) | |||
213 | if (data->max17047) | 233 | if (data->max17047) |
214 | i2c_unregister_device(data->max17047); | 234 | i2c_unregister_device(data->max17047); |
215 | 235 | ||
236 | device_connection_remove(&data->connections[2]); | ||
237 | device_connection_remove(&data->connections[1]); | ||
238 | device_connection_remove(&data->connections[0]); | ||
239 | |||
216 | return 0; | 240 | return 0; |
217 | } | 241 | } |
218 | 242 | ||