aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-02-02greybus: audio: Fix sparse warningsGravatar Viresh Kumar 2-0/+2
greybus/audio_apbridgea.c:13:5: warning: symbol 'gb_audio_apbridgea_set_config' was not declared. Should it be static? greybus/audio_apbridgea.c:30:5: warning: symbol 'gb_audio_apbridgea_register_cport' was not declared. Should it be static? greybus/audio_apbridgea.c:44:5: warning: symbol 'gb_audio_apbridgea_unregister_cport' was not declared. Should it be static? greybus/audio_apbridgea.c:58:5: warning: symbol 'gb_audio_apbridgea_set_tx_data_size' was not declared. Should it be static? greybus/audio_apbridgea.c:72:5: warning: symbol 'gb_audio_apbridgea_get_tx_delay' was not declared. Should it be static? greybus/audio_apbridgea.c:80:5: warning: symbol 'gb_audio_apbridgea_start_tx' was not declared. Should it be static? greybus/audio_apbridgea.c:94:5: warning: symbol 'gb_audio_apbridgea_stop_tx' was not declared. Should it be static? greybus/audio_apbridgea.c:106:5: warning: symbol 'gb_audio_apbridgea_set_rx_data_size' was not declared. Should it be static? greybus/audio_apbridgea.c:120:5: warning: symbol 'gb_audio_apbridgea_get_rx_delay' was not declared. Should it be static? greybus/audio_apbridgea.c:128:5: warning: symbol 'gb_audio_apbridgea_start_rx' was not declared. Should it be static? greybus/audio_apbridgea.c:141:5: warning: symbol 'gb_audio_apbridgea_stop_rx' was not declared. Should it be static? greybus/audio_gb.c:14:5: warning: symbol 'gb_audio_gb_get_topology' was not declared. Should it be static? greybus/audio_gb.c:48:5: warning: symbol 'gb_audio_gb_get_control' was not declared. Should it be static? greybus/audio_gb.c:70:5: warning: symbol 'gb_audio_gb_set_control' was not declared. Should it be static? greybus/audio_gb.c:85:5: warning: symbol 'gb_audio_gb_enable_widget' was not declared. Should it be static? greybus/audio_gb.c:97:5: warning: symbol 'gb_audio_gb_disable_widget' was not declared. Should it be static? greybus/audio_gb.c:109:5: warning: symbol 'gb_audio_gb_get_pcm' was not declared. Should it be static? greybus/audio_gb.c:133:5: warning: symbol 'gb_audio_gb_set_pcm' was not declared. Should it be static? greybus/audio_gb.c:150:5: warning: symbol 'gb_audio_gb_set_tx_data_size' was not declared. Should it be static? greybus/audio_gb.c:163:5: warning: symbol 'gb_audio_gb_get_tx_delay' was not declared. Should it be static? greybus/audio_gb.c:183:5: warning: symbol 'gb_audio_gb_activate_tx' was not declared. Should it be static? greybus/audio_gb.c:195:5: warning: symbol 'gb_audio_gb_deactivate_tx' was not declared. Should it be static? greybus/audio_gb.c:207:5: warning: symbol 'gb_audio_gb_set_rx_data_size' was not declared. Should it be static? greybus/audio_gb.c:220:5: warning: symbol 'gb_audio_gb_get_rx_delay' was not declared. Should it be static? greybus/audio_gb.c:240:5: warning: symbol 'gb_audio_gb_activate_rx' was not declared. Should it be static? greybus/audio_gb.c:252:5: warning: symbol 'gb_audio_gb_deactivate_rx' was not declared. Should it be static? Fix them by including the header that declares the exported routines. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-02greybus: audio_manager: use an 'ida' for the module idGravatar Greg Kroah-Hartman 1-4/+9
Every time we hotplug an audio module, we get a new audio module id. We should recycle them instead of just constantly incrementing the number so we don't see things like: [178016.832580] Created audio module #6124 in the kernel logs. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-01greybus: loopback_test: Decrease the max number of devicesGravatar Axel Haslam 1-1/+1
Its unrealistic to expect 50 loopback devices, and the mask parameter can hold up to "int" anyways so decrease to max number of devices to sane value. Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-01greybus: firmware: convert to bundle driverGravatar Johan Hovold 6-27/+130
Convert the legacy firmware protocol driver to a bundle driver. This also fixes a potential crash should a (malicious) module have sent an early request before the private data had been initialised. Note that the firmware protocol needs to support the version request indefinitely since it has been burnt into ROM. In order to avoid having to update current module-loading scripts, keep this driver internal to greybus core at least until modalias support is added. Note that there is no MODULE_DEVICE_TABLE defined for firmware as we cannot have two greybus tables in one module on ancient 3.10 kernels and that the legacy driver is currently also internal to core. This needs be added once the driver can be built as a module. Testing Done: Tested on DB3. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-01greybus: legacy: remove unimplemented classes from id tableGravatar Johan Hovold 1-3/+0
Remove the unimplemented display, sensor, and svc classes from the device-id table. As Viresh noted the SVC protocol is special and having an SVC class doesn't really make sense at all. Either way, the SVC protocol is already implemented by core. Testing Done: Compiled Reported-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-29greybus: arche-platform: reduce wait between WAKE_OUT checksGravatar Michael Scott 1-2/+2
SVC WAKE_OUT loop is estimated 400ms during which wake_detect line is pulled low for AP detection. On AP side we have 500ms delay between checks. To avoid timing issues, reduce delay between checks and raise total # of checks so that overall time for sequence is the same. Testing Done: - Used for DB3.5/EVT1.5 hardware during bringup - Regression tested on DB3.1+ES2, DB3.1+ES3 Signed-off-by: Michael Scott <michael.scott@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-29greybus: arche-platform: assert wake-detect to complete WAKE_OUT eventGravatar Michael Scott 1-2/+4
After SVC generates WAKE_OUT (pulling wake-detect pin low) and APB is brought out of reset, we need to assert wake-detect again to complete SVC WAKE_OUT logic. Testing Done: - Used for DB3.5/EVT1.5 hardware during bringup - Regression tested on DB3.1+ES2, DB3.1+ES3 Signed-off-by: Michael Scott <michael.scott@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-29greybus: arche-platform: bring SVC out of reset later in probeGravatar Michael Scott 1-4/+4
Move SVC deassert reset to after wake-detect pin has been pulled low in probe. Otherwise, SVC may trigger WAKE_OUT based on a default high signal. Testing Done: - Used for DB3.5/EVT1.5 hardware during bringup - Regression tested on DB3.1+ES2, DB3.1+ES3 Signed-off-by: Michael Scott <michael.scott@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-29greybus: arche-platform: ensure wake-detect pin is deassertedGravatar Michael Scott 1-0/+2
During DB3.5 bringup, it was noted that wake_detect signal was not properly generating SVC edge IRQ. To ensure signal goes from low to high correctly, let's bring signal low (regardless of default pin state). Testing Done: - Used for DB3.5/EVT1.5 hardware during bringup - Regression tested on DB3.1+ES2, DB3.1+ES3 Signed-off-by: Michael Scott <michael.scott@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Tested-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-28greybus: hd: fix host-device-removal raceGravatar Johan Hovold 1-2/+5
Make sure to tear down the svc and flush any on-going hotplug processing before removing the remaining interfaces. This fixes crashes due to host-device removal racing with svc hotplug/unplug processing (e.g. at "UniPro restart"). Testing Done: Verified that this fixes crashes reproducible on SDB when unloading the host-device driver module while generating hotplug/unplug events. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-27greybus: audio: Rename Audio class and remove the unused oneGravatar Viresh Kumar 2-3/+3
There should be a single class macro for Audio and two protocol macros. Rename class with value 0x12 as GREYBUS_CLASS_AUDIO and remove the other unused class GREYBUS_CLASS_AUDIO_DATA. 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>
2016-01-27greybus: audio_codec: convert to bundle driverGravatar Viresh Kumar 4-70/+202
Convert the legacy audio management and data protocol drivers to a bundle driver. The Audio bundle driver can support a single management and any number of data cports, and so we expect multiple data cports to be present for the bundle during initialization. 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>
2016-01-27greybus: audio_codec: Free gccodec on dia probe failureGravatar Viresh Kumar 1-2/+9
We aren't freeing the codec, that we allocated before failing to probe the connection. Free it. 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>
2016-01-27greybus: audio_codec: Free gccodec on codec probe failureGravatar Viresh Kumar 1-0/+1
We aren't freeing the codec, that we allocated before failing to probe the connection. Free it. 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>
2016-01-27greybus: legacy: fix a null pointer dereferenceGravatar Bartosz Golaszewski 1-0/+3
When gb_protocol_get() fails in legacy_connection_create(), we end up bailing-out before assigning lc->connection and lc->protocol. Calling legacy_connection_destroy() in that case results in a null pointer dereference. Check if lc->connection is not null before freeing it. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-26greybus: loopback_test: make output to csv file a parameter optionGravatar Axel Haslam 1-4/+8
Its useful to get a CSV output on stdout for test frameworks to read and parse the results. However, a csv file is not always needed. Add the -z option to create/append a csv file only when the user asks for it. Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-26greybus: svc watchdog: allow it to be enabled/disabled from userspaceGravatar Greg Kroah-Hartman 4-9/+94
Sometimes you want to disable the SVC watchdog without having to patch your kernel, so provide a sysfs file to do this. This can let us do power measurements, and let the firmware developers not go crazy worrying that the kernel is going to reset their chips with no notice. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-26greybus: camera: only build module against msm kernelGravatar Greg Kroah-Hartman 1-1/+3
The camera driver currently does not build against anything other than the msm kernel, due to cross-dependancies, so enable that here so that we can build against other kernels without failing the build. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Tested-by: Marti Bolivar <mbolivar@leaflabs.com> Acked-by: Laurent Pinchart <laurent.pinchart@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-26greybus: svc: double the ping delay timeoutGravatar Greg Kroah-Hartman 1-2/+3
Sometimes the ping response comes back _right_ after we timed out, as the svc got its act together and squeaked out the ack, yet we miss it and reset the whole bus. Double the delay to hopefully give the svc a little more of a chance to fix itself. Odds are, it's still in trouble, but we can just hold off resetting it for a bit more... Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-25greybus: arche-platform: Disable clock as part of driver removeGravatar Vaibhav Hiremath 2-0/+5
As part of driver remove (cleanup) function, disable the clock for both SVC, APB1 & APB2. Testing Done: Tested on EVT1 platform with Connect=>disconnect=>connect iteration, almost close to 100 iterations have passed (demo branch). And also tested with kernel-only build. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-25greybus: camera: Stream config change unipro speedGravatar Jacopo Mondi 1-22/+88
Unipro network speed was increased at camera initialization time and never slowed down. This unnecessary drains power during the entire time camera module is plugged in. Increasing/decreasing unipro link speed before issuing stream configuration request to camera module prevents this from happening. Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-23greybus: svc: return proper error code on watchdog create errorGravatar Greg Kroah-Hartman 1-0/+1
When the watchdog is not created properly, we need to propagate the error for this and not just return success. Reported-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-23greybus: svc: add a "watchdog" to check the network healthGravatar Greg Kroah-Hartman 4-0/+123
Now that we have a svc ping command, let's add a watchdog to call it every so often (1 second at the moment.) If it finds something went wrong, post a stern message to the kernel log and call: start unipro_reset to reset the whole greybus hardware subsystem. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-22greybus: lsgb: Minor tweaksGravatar Greg Kroah-Hartman 1-6/+8
Make it executable on an Android system Change layout to be show heirachy a bit better. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-22greybus: camera: add semiplanar and planar formatsGravatar Gjorgji Rosikopulos 1-2/+10
This change adds missing planar and semiplanar formats from gb specification. Mbus to Gb format map: V4L2_MBUS_FMT_NV12_1x8 -> 0x12 V4L2_MBUS_FMT_NV21_1x8 -> 0x13 V4L2_MBUS_FMT_YV12_1x8 -> 0x16 V4L2_MBUS_FMT_YU12_1x8 -> 0x17 Change depends on: "media: add new mediabus format enums for ara camera" Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-22greybus: svc: Expose and retain VID/PID received from bootrom for ES2Gravatar Viresh Kumar 2-10/+36
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>
2016-01-22greybus: lsgb: add lsgb shell scriptGravatar Greg Kroah-Hartman 1-0/+149
Horrid hack, but a start at making it easier for people to see what is currently connected without having to deal with poking around in sysfs directly. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: audio_codec: update codec_name as per driver->nameGravatar Vaibhav Agarwal 1-1/+2
Originally, driver->name was not poluated from GB and thus manually set from audio_codec driver as a hack. This is no more required. Another patch already removes that hack. Now, with new driver->name as "legacy.<id-bundle.interface>" codec is registered with different name. So, during DAI link registration as well it needs modification. Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: firmware: abort if AP_READY failsGravatar Johan Hovold 1-9/+7
Abort if the AP_READY request fails. Also update the comment suggesting that this operation was a temporary one. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: vibrator: convert to bundle driverGravatar Johan Hovold 2-22/+54
Convert the legacy vibrator protocol driver to a bundle driver. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: hid: convert to bundle driverGravatar Johan Hovold 2-20/+51
Convert the legacy HID protocol driver to a bundle driver. This also fixes a potential crash should a (malicious) module have sent an early request before the private data had been initialised. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: hid: clean up init error pathsGravatar Johan Hovold 1-7/+9
Separate success and error paths more clearly. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: set request handlers at creationGravatar Johan Hovold 4-46/+82
Set the connection request handler at creation rather than when enabling the connection. This is possible now that connections are created by the drivers that use them rather than by core at manifest parsing time. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: legacy: look up protocol at connection creationGravatar Johan Hovold 1-49/+42
Look up legacy protocol at connection create instead of at init. Note that we can now look up the protocol before even creating the actual connection. This is needed to be able to set a connection request handler when creating the connection rather than when enabling it. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: remove legacy protocol id from coreGravatar Johan Hovold 2-9/+7
Remove legacy protocol-id field that is only used by the legacy-protocol driver from the connection structure. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: legacy: add initialized flagGravatar Johan Hovold 1-1/+6
Add initialized flag and use instead of the connection protocol pointer to determine when the legacy connection has been initialised. This is a step in moving legacy connection binding to connection-creation time. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: legacy: refactor legacy-connection handlingGravatar Johan Hovold 1-22/+45
Add wrapper structure for legacy connections and add helpers to create and destroy legacy connections. This is a step in removing legacy connection fields from the core structures. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: return error-valued pointer on creation errorsGravatar Johan Hovold 4-14/+29
Return an ERR_PTR on errors when creating connections. This allows driver probe to fail with a more informative error message as not all connection creation errors are due to memory exhaustion. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: rename connection-create interfaceGravatar Johan Hovold 3-9/+9
Drop the _dynamic suffix from the exported interface that drivers use to create connections. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: simplify connection-creation interfaceGravatar Johan Hovold 3-7/+6
Simplify the exported generic interface for creating dynamic connections. Since all driver connections will have a bundle we can drop the redundant interface parameter. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: drop the legacy protocol-id parameterGravatar Johan Hovold 3-14/+9
The protocol-id parameter is only used by the legacy driver so remove it from the generic interface and move it to the legacy driver until it can be removed completely. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: add helper to create control connectionsGravatar Johan Hovold 3-3/+8
Add dedicated helper to create control connections. This will allow us to simplify the generic (dynamic) interface. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: connection: drop protocol parameter from static interfaceGravatar Johan Hovold 3-7/+4
Drop legacy protocol parameter from static connection interface. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: manifest: check for duplicate CPort descriptors when parsingGravatar Johan Hovold 1-3/+14
Now that connection creation has been separated from interface initialisation, we should explicitly check for duplicate CPort descriptors when parsing the manifest. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: core: defer connection creation to driver probeGravatar Johan Hovold 6-42/+77
Defer connection creation to bundle driver probe instead of creating them when initialising the interface and parsing the manifest. Store copies of the CPorts descriptors in the bundle for the drivers to use, and update the legacy driver. This is needed for drivers that need more control over host-device resource management, for example, when a protocol needs to use a dedicated host CPort for traffic offloading (e.g. camera data). This also avoids allocating host CPorts for bundles that are not bound to a driver or for remote CPorts that a driver does not need. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: add bundle class to the bundle ueventGravatar Greg Kroah-Hartman 1-0/+2
When bundles are added and then removed, we have a race where we go to read the sysfs file, but it is now for a different bundle than the uevent was originally for. So add the bundle class to the uevent so we "know" what the correct bundle class was. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: svc: add ping commandGravatar Greg Kroah-Hartman 3-0/+9
This implements the SVC "ping" command. It's tiny and simple, but we need something like this in order for us to "know" if all is working well. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21greybus: firmware: log the name of the firmware being requestedGravatar Greg Kroah-Hartman 1-2/+11
People are getting confused as to what the firmware file name is for their module, so log it to make it easier to find modules with "blank" vid/pid values and let people know what to name their firmware files. Because we are now logging this, turn the debug message after the firmware request into an error message if something fails. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Michael Scott <michael.scott@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-20greybus: svc: add key event handlingGravatar Rui Miguel Silva 3-6/+121
Add a new input device associated with the SVC to handle key events. This new events are transfer over a new greybus svc operation which is unidirectional. It was selected the KEY_A for representing the KEY_ARA_BUTTON key code. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-20greybus: audio_codec: Don't be tricky with the driver modelGravatar Greg Kroah-Hartman 1-15/+0
With the recent changes by Johan to the driver model of the greybus code, the audio_codec no longer should need to provide a "dummy" driver when registering the codec. In fact, having it there causes the greybus core to crash when inserting the module. Removing it all fixes the crash. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>