greybus: svc: Expose and retain VID/PID received from bootrom for ES2
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 22 Jan 2016 10:46:08 +0000 (16:16 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 22 Jan 2016 23:24:58 +0000 (15:24 -0800)
commitf3e6c0971af62c81d0a9f0b408ae0e97248e2976
treed335a54223efce6b9f4edee1803911ebc5f14da9
parentfd7c28ebf03d7c5c293ac07fd178640582c8c137
greybus: svc: Expose and retain VID/PID received from bootrom for ES2

ES2 chips doesn't have efuses for storing module's vendor_id and
product_id and so we have hacked bootrom earlier using firmware
protocol, so that VID/PID can be received for fetching firmware
packages.

Another requirement is to expose them to sysfs, so that modules can be
identified properly.

That can be easily solved by updating interface's VID/PID, when fetched
using firmware protocol and later reusing them while the module switches
its identity from bootrom to firmware.

Do that only if the module is ES2 and the VID/PID sent during hotplug
are both 0.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/firmware.c
drivers/staging/greybus/svc.c