aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/dsi.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-01 17:40:04 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 09:13:26 -0400
commitf3ed97f9ae7df6a36025b94e1943492e73691f7c (patch)
tree8eb0253473bc8ecc73bbf0c698de0a4e4722072a /drivers/gpu/drm/omapdrm/dss/dsi.c
parent7269fde4e8c96e67cd39f456cabf3329b06efffc (diff)
drm/omap: dsi: Simplify debugfs implementation
The DSI debugfs regs and irqs show handlers received a pointer to the DSI private data. There's no need to look it up from the list of DSS outputs. Use the pointer directly, this allows simplifying the implementation of the handlers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/dsi.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c63
1 files changed, 14 insertions, 49 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 8e3dce1ddfb0..6b16eec0b2b2 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -1518,8 +1518,9 @@ void dsi_dump_clocks(struct seq_file *s)
1518} 1518}
1519 1519
1520#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS 1520#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
1521static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s) 1521static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
1522{ 1522{
1523 struct dsi_data *dsi = p;
1523 unsigned long flags; 1524 unsigned long flags;
1524 struct dsi_irq_stats stats; 1525 struct dsi_irq_stats stats;
1525 1526
@@ -1603,33 +1604,20 @@ static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s)
1603 PIS(ULPSACTIVENOT_ALL0); 1604 PIS(ULPSACTIVENOT_ALL0);
1604 PIS(ULPSACTIVENOT_ALL1); 1605 PIS(ULPSACTIVENOT_ALL1);
1605#undef PIS 1606#undef PIS
1606}
1607
1608static int dsi1_dump_irqs(struct seq_file *s, void *p)
1609{
1610 struct dsi_data *dsi = dsi_get_dsi_from_id(0);
1611 1607
1612 dsi_dump_dsi_irqs(dsi, s);
1613 return 0;
1614}
1615
1616static int dsi2_dump_irqs(struct seq_file *s, void *p)
1617{
1618 struct dsi_data *dsi = dsi_get_dsi_from_id(1);
1619
1620 dsi_dump_dsi_irqs(dsi, s);
1621 return 0; 1608 return 0;
1622} 1609}
1623#endif 1610#endif
1624 1611
1625static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s) 1612static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
1626{ 1613{
1627#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r)) 1614 struct dsi_data *dsi = p;
1628 1615
1629 if (dsi_runtime_get(dsi)) 1616 if (dsi_runtime_get(dsi))
1630 return; 1617 return 0;
1631 dsi_enable_scp_clk(dsi); 1618 dsi_enable_scp_clk(dsi);
1632 1619
1620#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r))
1633 DUMPREG(DSI_REVISION); 1621 DUMPREG(DSI_REVISION);
1634 DUMPREG(DSI_SYSCONFIG); 1622 DUMPREG(DSI_SYSCONFIG);
1635 DUMPREG(DSI_SYSSTATUS); 1623 DUMPREG(DSI_SYSSTATUS);
@@ -1699,25 +1687,11 @@ static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s)
1699 DUMPREG(DSI_PLL_GO); 1687 DUMPREG(DSI_PLL_GO);
1700 DUMPREG(DSI_PLL_CONFIGURATION1); 1688 DUMPREG(DSI_PLL_CONFIGURATION1);
1701 DUMPREG(DSI_PLL_CONFIGURATION2); 1689 DUMPREG(DSI_PLL_CONFIGURATION2);
1690#undef DUMPREG
1702 1691
1703 dsi_disable_scp_clk(dsi); 1692 dsi_disable_scp_clk(dsi);
1704 dsi_runtime_put(dsi); 1693 dsi_runtime_put(dsi);
1705#undef DUMPREG
1706}
1707
1708static int dsi1_dump_regs(struct seq_file *s, void *p)
1709{
1710 struct dsi_data *dsi = dsi_get_dsi_from_id(0);
1711 1694
1712 dsi_dump_dsi_regs(dsi, s);
1713 return 0;
1714}
1715
1716static int dsi2_dump_regs(struct seq_file *s, void *p)
1717{
1718 struct dsi_data *dsi = dsi_get_dsi_from_id(1);
1719
1720 dsi_dump_dsi_regs(dsi, s);
1721 return 0; 1695 return 0;
1722} 1696}
1723 1697
@@ -5305,6 +5279,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
5305 struct dsi_data *dsi; 5279 struct dsi_data *dsi;
5306 struct resource *dsi_mem; 5280 struct resource *dsi_mem;
5307 struct resource *res; 5281 struct resource *res;
5282 char name[10];
5308 5283
5309 dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); 5284 dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
5310 if (!dsi) 5285 if (!dsi)
@@ -5443,23 +5418,13 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
5443 5418
5444 dsi_runtime_put(dsi); 5419 dsi_runtime_put(dsi);
5445 5420
5446 if (dsi->module_id == 0) 5421 snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
5447 dsi->debugfs.regs = dss_debugfs_create_file(dss, "dsi1_regs", 5422 dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
5448 dsi1_dump_regs, 5423 dsi_dump_dsi_regs, &dsi);
5449 &dsi);
5450 else
5451 dsi->debugfs.regs = dss_debugfs_create_file(dss, "dsi2_regs",
5452 dsi2_dump_regs,
5453 &dsi);
5454#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS 5424#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
5455 if (dsi->module_id == 0) 5425 snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
5456 dsi->debugfs.irqs = dss_debugfs_create_file(dss, "dsi1_irqs", 5426 dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
5457 dsi1_dump_irqs, 5427 dsi_dump_dsi_irqs, &dsi);
5458 &dsi);
5459 else
5460 dsi->debugfs.irqs = dss_debugfs_create_file(dss, "dsi2_irqs",
5461 dsi2_dump_irqs,
5462 &dsi);
5463#endif 5428#endif
5464 5429
5465 return 0; 5430 return 0;