summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/svc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-01-06 16:16:46 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-01-08 22:14:08 -0800
commitaab4a1a3684a46b423af23e4bdc9afe1b28dc389 (patch)
tree92e483d7351aadd2e1da06de33a65b86e6183e58 /drivers/staging/greybus/svc.c
parente49268cc336eceb0653a03c4a0f9eb53eadf4d64 (diff)
downloadop-kernel-dev-aab4a1a3684a46b423af23e4bdc9afe1b28dc389.zip
op-kernel-dev-aab4a1a3684a46b423af23e4bdc9afe1b28dc389.tar.gz
greybus: svc: Replace link config hack with standard operation
The link config operation was a hack only designed to fulfill the camera driver's needs. Now that a standard operation is defined for the same purpose, implement it and remove the hack. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/svc.c')
-rw-r--r--drivers/staging/greybus/svc.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index fe7bd28..c4c3bb5 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -285,22 +285,35 @@ static void gb_svc_route_destroy(struct gb_svc *svc, u8 intf1_id, u8 intf2_id)
}
}
-int gb_svc_link_config(struct gb_svc *svc, u8 intf_id,
- unsigned int burst, unsigned int gear,
- unsigned int nlanes, unsigned int flags)
+int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series,
+ u8 tx_mode, u8 tx_gear, u8 tx_nlanes,
+ u8 rx_mode, u8 rx_gear, u8 rx_nlanes,
+ u8 flags, u32 quirks)
{
- struct gb_svc_link_config_request request;
+ struct gb_svc_intf_set_pwrm_request request;
+ struct gb_svc_intf_set_pwrm_response response;
+ int ret;
request.intf_id = intf_id;
- request.burst = burst;
- request.gear = gear;
- request.nlanes = nlanes;
+ request.hs_series = hs_series;
+ request.tx_mode = tx_mode;
+ request.tx_gear = tx_gear;
+ request.tx_nlanes = tx_nlanes;
+ request.rx_mode = rx_mode;
+ request.rx_gear = rx_gear;
+ request.rx_nlanes = rx_nlanes;
request.flags = flags;
+ request.quirks = cpu_to_le32(quirks);
- return gb_operation_sync(svc->connection, GB_SVC_TYPE_LINK_CONFIG,
- &request, sizeof(request), NULL, 0);
+ ret = gb_operation_sync(svc->connection, GB_SVC_TYPE_INTF_SET_PWRM,
+ &request, sizeof(request),
+ &response, sizeof(response));
+ if (ret < 0)
+ return ret;
+
+ return le16_to_cpu(response.result_code);
}
-EXPORT_SYMBOL_GPL(gb_svc_link_config);
+EXPORT_SYMBOL_GPL(gb_svc_intf_set_power_mode);
static int gb_svc_version_request(struct gb_operation *op)
{
OpenPOWER on IntegriCloud