From 28fae81f93d5482f25bb8e9881104ad1157c2cfd Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 2 Dec 2015 17:24:20 +0100 Subject: gpu: host1x: Use platform_register/unregister_drivers() These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding --- drivers/gpu/host1x/dev.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'drivers/gpu/host1x/dev.c') diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 53d3d1d45b48..64d9b707ee1a 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -212,6 +212,11 @@ static struct platform_driver tegra_host1x_driver = { .remove = host1x_remove, }; +static struct platform_driver * const drivers[] = { + &tegra_host1x_driver, + &tegra_mipi_driver, +}; + static int __init tegra_host1x_init(void) { int err; @@ -220,28 +225,17 @@ static int __init tegra_host1x_init(void) if (err < 0) return err; - err = platform_driver_register(&tegra_host1x_driver); - if (err < 0) - goto unregister_bus; - - err = platform_driver_register(&tegra_mipi_driver); + err = platform_register_drivers(drivers, ARRAY_SIZE(drivers)); if (err < 0) - goto unregister_host1x; + bus_unregister(&host1x_bus_type); - return 0; - -unregister_host1x: - platform_driver_unregister(&tegra_host1x_driver); -unregister_bus: - bus_unregister(&host1x_bus_type); return err; } module_init(tegra_host1x_init); static void __exit tegra_host1x_exit(void) { - platform_driver_unregister(&tegra_mipi_driver); - platform_driver_unregister(&tegra_host1x_driver); + platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); bus_unregister(&host1x_bus_type); } module_exit(tegra_host1x_exit); -- cgit v1.2.3 From a134789a67480e6cc7e50c9dfcbc7adca5016010 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 23 Mar 2015 10:46:28 +0100 Subject: gpu: host1x: Add Tegra210 support The host1x unit found in Tegra210 SoCs is very similar to the unit in Tegra124, but it has 2 additional channels for a total of 14 channels. Signed-off-by: Thierry Reding --- drivers/gpu/host1x/dev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/gpu/host1x/dev.c') diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 64d9b707ee1a..314bf3718cc7 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -35,6 +35,7 @@ #include "hw/host1x01.h" #include "hw/host1x02.h" #include "hw/host1x04.h" +#include "hw/host1x05.h" void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r) { @@ -87,7 +88,17 @@ static const struct host1x_info host1x04_info = { .sync_offset = 0x2100, }; +static const struct host1x_info host1x05_info = { + .nb_channels = 14, + .nb_pts = 192, + .nb_mlocks = 16, + .nb_bases = 64, + .init = host1x05_init, + .sync_offset = 0x2100, +}; + static struct of_device_id host1x_of_match[] = { + { .compatible = "nvidia,tegra210-host1x", .data = &host1x05_info, }, { .compatible = "nvidia,tegra124-host1x", .data = &host1x04_info, }, { .compatible = "nvidia,tegra114-host1x", .data = &host1x02_info, }, { .compatible = "nvidia,tegra30-host1x", .data = &host1x01_info, }, -- cgit v1.2.3