diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-02-13 20:34:41 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-03-21 08:44:15 -0700 |
commit | a0f946efbef9caa197ad2048d45722f65618d6c3 (patch) | |
tree | 1d92dfe33f44c8119cfe4a141812f6d3b9309926 /drivers/video/tegra/host/dsi | |
parent | 4e1ec69f7c1b5a259d7df0435647e9005f1e033c (diff) |
video: tegra: host: refactor for upstreaming
- split the nvhost clients into their own directories
- each client is a nvhost_device and nvhost_driver
- all the code related to host1x control node is centralized
at single place in dev.c
- all the code related to host1x modules nodes is centralized
at single place in bus_client.c
- update the copyright notice & year for new files
Bug 871237
Change-Id: Ief85064699e35ad02b48a7e54496928d7f085af4
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/83491
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/dsi')
-rw-r--r-- | drivers/video/tegra/host/dsi/Makefile | 7 | ||||
-rw-r--r-- | drivers/video/tegra/host/dsi/dsi.c | 82 |
2 files changed, 89 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/dsi/Makefile b/drivers/video/tegra/host/dsi/Makefile new file mode 100644 index 000000000000..eb94d3ec4928 --- /dev/null +++ b/drivers/video/tegra/host/dsi/Makefile @@ -0,0 +1,7 @@ +GCOV_PROFILE := y +EXTRA_CFLAGS += -Idrivers/video/tegra/host + +nvhost-dsi-objs = \ + dsi.o + +obj-$(CONFIG_TEGRA_GRHOST) += nvhost-dsi.o diff --git a/drivers/video/tegra/host/dsi/dsi.c b/drivers/video/tegra/host/dsi/dsi.c new file mode 100644 index 000000000000..0e49f591574d --- /dev/null +++ b/drivers/video/tegra/host/dsi/dsi.c @@ -0,0 +1,82 @@ +/* + * drivers/video/tegra/host/dsi/dsi.c + * + * Tegra Graphics DSI + * + * Copyright (c) 2012, NVIDIA Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "dev.h" +#include "bus_client.h" + +static int dsi_probe(struct nvhost_device *dev) +{ + return nvhost_client_device_init(dev); +} + +static int __exit dsi_remove(struct nvhost_device *dev) +{ + /* Add clean-up */ + return 0; +} + +static int dsi_suspend(struct nvhost_device *dev, pm_message_t state) +{ + return nvhost_client_device_suspend(dev); +} + +static int dsi_resume(struct nvhost_device *dev) +{ + dev_info(&dev->dev, "resuming\n"); + return 0; +} + +struct nvhost_device *dsi_device; + +static struct nvhost_driver dsi_driver = { + .probe = dsi_probe, + .remove = __exit_p(dsi_remove), +#ifdef CONFIG_PM + .suspend = dsi_suspend, + .resume = dsi_resume, +#endif + .driver = { + .owner = THIS_MODULE, + .name = "dsi", + } +}; + +static int __init dsi_init(void) +{ + int err; + + dsi_device = nvhost_get_device("dsi"); + if (!dsi_device) + return -ENXIO; + + err = nvhost_device_register(dsi_device); + if (err) + return err; + + return nvhost_driver_register(&dsi_driver); +} + +static void __exit dsi_exit(void) +{ + nvhost_driver_unregister(&dsi_driver); +} + +module_init(dsi_init); +module_exit(dsi_exit); |