Skip to contentSkip to conversation

gpu: host1x: Sort includes alphabetically

PATCH New Thierry Reding 1 participant 2 messages Mar 21, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gpu: host1x: Sort includes alphabetically

From: Thierry Reding <[email protected]>

Sorting includes alphabetically makes it easier and less conflict-prone to add new includes subsequently.

---
 drivers/gpu/host1x/dev.c | 12 ++++++------
 drivers/gpu/host1x/dev.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/host1x/dev.c +6 -6
index a62317af76ad..6c17c4900166 100644
@@ -16,14 +16,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/slab.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/clk.h>
-#include <linux/io.h>
 #include <linux/dma-mapping.h>
+#include <linux/io.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/slab.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/host1x.h>
drivers/gpu/host1x/dev.h +1 -1
index 06dd4f85125f..862285f2cfb8 100644
@@ -17,8 +17,8 @@
 #ifndef HOST1X_DEV_H
 #define HOST1X_DEV_H
 
-#include <linux/platform_device.h>
 #include <linux/device.h>
+#include <linux/platform_device.h>
 
 #include "channel.h"
 #include "syncpt.h"
Signature · 6 lines
2.12.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 gpu: host1x: Support module reset

From: Thierry Reding <[email protected]>

Newer versions of Tegra come with early boot software that aggressively puts various modules in reset. Add support to the host1x driver to take the module out of reset on probe, and assert reset on removal.

---
 drivers/gpu/host1x/dev.c | 18 +++++++++++++++++-
 drivers/gpu/host1x/dev.h |  2 ++
 2 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/host1x/dev.c +17 -1
index 6c17c4900166..f5dd6a06f798 100644
@@ -168,6 +168,13 @@ static int host1x_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	host->rst = devm_reset_control_get(&pdev->dev, "host1x");
+	if (IS_ERR(host->rst)) {
+		err = PTR_ERR(host->clk);
+		dev_err(&pdev->dev, "failed to get reset: %d\n", err);
+		return err;
+	}
+
 	err = host1x_channel_list_init(host);
 	if (err) {
 		dev_err(&pdev->dev, "failed to initialize channel list\n");
@@ -180,10 +187,16 @@ static int host1x_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	err = reset_control_deassert(host->rst);
+	if (err < 0) {
+		dev_err(&pdev->dev, "failed to deassert reset: %d\n", err);
+		goto fail_unprepare_disable;
+	}
+
 	err = host1x_syncpt_init(host);
 	if (err) {
 		dev_err(&pdev->dev, "failed to initialize syncpts\n");
-		goto fail_unprepare_disable;
+		goto fail_reset_assert;
 	}
 
 	err = host1x_intr_init(host, syncpt_irq);
@@ -204,6 +217,8 @@ static int host1x_probe(struct platform_device *pdev)
 	host1x_intr_deinit(host);
 fail_deinit_syncpt:
 	host1x_syncpt_deinit(host);
+fail_reset_assert:
+	reset_control_assert(host->rst);
 fail_unprepare_disable:
 	clk_disable_unprepare(host->clk);
 	return err;
@@ -216,6 +231,7 @@ static int host1x_remove(struct platform_device *pdev)
 	host1x_unregister(host);
 	host1x_intr_deinit(host);
 	host1x_syncpt_deinit(host);
+	reset_control_deassert(host->rst);
 	clk_disable_unprepare(host->clk);
 
 	return 0;
drivers/gpu/host1x/dev.h +2 -0
index 862285f2cfb8..758cd3feb545 100644
@@ -19,6 +19,7 @@
 
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 
 #include "channel.h"
 #include "syncpt.h"
@@ -107,6 +108,7 @@ struct host1x {
 	struct host1x_syncpt_base *bases;
 	struct device *dev;
 	struct clk *clk;
+	struct reset_control *rst;
 
 	struct mutex intr_mutex;
 	int intr_syncpt_irq;
Signature · 6 lines
2.12.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel