aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/camera.c
diff options
context:
space:
mode:
authorEli Sennesh <esennesh@leaflabs.com>2016-06-03 11:24:44 -0400
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-09 18:14:00 -0700
commit8c2522d87ab20ba245ddf92e4e8b19a76e5760fd (patch)
treeb8524650818e94f2154a0557ecdbb5b2b0795ff5 /drivers/staging/greybus/camera.c
parentgreybus: connection: Avoid unnecessary line breaks (diff)
downloadlinux-dev-8c2522d87ab20ba245ddf92e4e8b19a76e5760fd.tar.xz
linux-dev-8c2522d87ab20ba245ddf92e4e8b19a76e5760fd.zip
greybus: update UniPro Set Interface Power Mode operation to match spec
Bring the gb_svc_intf_set_power_mode() up-to-date with the current Greybus specification. This largely involves adding more members to the structure sent across the wire. Also change the camera code to use the new operation properly, with default values passed for the new necessary arguments. The correctness of these default values is confirmed via testing and by asking Rob Johnson. We must make sure to zero the request structure sent across the wire, lest bite us most cruelly, and we fix by changing the Set Power Mode Response structure to use a __u8 rather than a __le16. Testing Done: Took a picture with a camera module, received error code when passing deliberately incorrect values for new parameters, got proper -EIO and Greybus result code printed when operation stopped halfway through. Could induce error by initializing request struct with random nonsense, and can stop it by initializing request struct with zeroes. Associated Firmware Changes: 1669-1671 on Android N Gerrit for SW-2945 Signed-off-by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/camera.c')
-rw-r--r--drivers/staging/greybus/camera.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c
index 162cb7d294cd..ca1f4989197f 100644
--- a/drivers/staging/greybus/camera.c
+++ b/drivers/staging/greybus/camera.c
@@ -128,17 +128,23 @@ static int gb_camera_set_intf_power_mode(struct gb_camera *gcam, u8 intf_id,
ret = gb_svc_intf_set_power_mode(svc, intf_id,
GB_SVC_UNIPRO_HS_SERIES_A,
GB_SVC_UNIPRO_FAST_MODE, 2, 2,
+ GB_SVC_SMALL_AMPLITUDE,
+ GB_SVC_NO_DE_EMPHASIS,
GB_SVC_UNIPRO_FAST_MODE, 2, 2,
GB_SVC_PWRM_RXTERMINATION |
- GB_SVC_PWRM_TXTERMINATION, 0);
+ GB_SVC_PWRM_TXTERMINATION, 0,
+ NULL, NULL);
else
ret = gb_svc_intf_set_power_mode(svc, intf_id,
GB_SVC_UNIPRO_HS_SERIES_A,
GB_SVC_UNIPRO_SLOW_AUTO_MODE,
2, 1,
+ GB_SVC_SMALL_AMPLITUDE,
+ GB_SVC_NO_DE_EMPHASIS,
GB_SVC_UNIPRO_SLOW_AUTO_MODE,
2, 1,
- 0, 0);
+ 0, 0,
+ NULL, NULL);
return ret;
}