aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/tegra-hsp.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-06mailbox: tegra-hsp: mark suspend function as __maybe_unusedArnd Bergmann1-1/+1
We get a warning about this being unused when CONFIG_PM is disabled: drivers/mailbox/tegra-hsp.c:782:12: error: 'tegra_hsp_resume' defined but not used [-Werror=unused-function] Fixes: 9a63f0f40599 ("mailbox: tegra-hsp: Add suspend/resume support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-12-21mailbox: tegra-hsp: Use device-managed registration APIThierry Reding1-24/+6
In order to get rid of a lot of cleanup boilerplate code, use the device-managed registration API. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-12-21mailbox: tegra-hsp: use devm_kstrdup_const()Bartosz Golaszewski1-32/+4
Use devm_kstrdup_const() in the tegra-hsp driver. This mostly serves as an example of how to use this new routine to shrink driver code. Also use devm_kzalloc() instead of regular kzalloc() to shrink the driver even more. Doorbell objects are only removed in the driver's remove callback so it's safe to convert all memory allocations to devres. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-12-21mailbox: tegra-hsp: Add suspend/resume supportThierry Reding1-0/+19
Upon resuming from a system sleep state, the interrupts for all active shared mailboxes need to be reenabled, otherwise they will not work. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-12-21mailbox: tegra-hsp: Add support for shared mailboxesThierry Reding1-61/+443
The Tegra HSP block supports 'shared mailboxes' that are simple 32-bit registers consisting of a FULL bit in MSB position and 31 bits of data. The hardware can be configured to trigger interrupts when a mailbox is empty or full. Add support for these shared mailboxes to the HSP driver. The initial use for the mailboxes is the Tegra Combined UART. For this purpose, we use interrupts to receive data, and spinning to wait for the transmit mailbox to be emptied to minimize unnecessary overhead. Based on work by Mikko Perttunen <mperttunen@nvidia.com>. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2016-11-18mailbox: tegra-hsp: Use after free in tegra_hsp_remove_doorbells()Dan Carpenter1-2/+2
We have to use the _safe version of list_for_each() because we're freeing the pointer as we go along. (This might not show up testing depending on what config options you have enabled). Fixes: 0fe88461a0ec ("mailbox: Add Tegra HSP driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-11-18mailbox: Add Tegra HSP driverThierry Reding1-0/+479
This driver exposes a mailbox interface for interprocessor communication using the Hardware Synchronization Primitives (HSP) module's doorbell mechanism. There are multiple HSP instances and they provide additional features such as shared mailboxes, shared and arbitrated semaphores. A driver for a remote processor can use the mailbox client provided by the HSP driver and build an IPC protocol on top of this synchronization mechanism. Based on work by Joseph Lo <josephl@nvidia.com>. Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com>