Commit f3ed97f9 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 7269fde4
...@@ -1518,8 +1518,9 @@ void dsi_dump_clocks(struct seq_file *s) ...@@ -1518,8 +1518,9 @@ void dsi_dump_clocks(struct seq_file *s)
} }
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s) static int dsi_dump_dsi_irqs(struct seq_file *s, void *p)
{ {
struct dsi_data *dsi = p;
unsigned long flags; unsigned long flags;
struct dsi_irq_stats stats; struct dsi_irq_stats stats;
...@@ -1603,33 +1604,20 @@ static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s) ...@@ -1603,33 +1604,20 @@ static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s)
PIS(ULPSACTIVENOT_ALL0); PIS(ULPSACTIVENOT_ALL0);
PIS(ULPSACTIVENOT_ALL1); PIS(ULPSACTIVENOT_ALL1);
#undef PIS #undef PIS
}
static int dsi1_dump_irqs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = dsi_get_dsi_from_id(0);
dsi_dump_dsi_irqs(dsi, s);
return 0;
}
static int dsi2_dump_irqs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = dsi_get_dsi_from_id(1);
dsi_dump_dsi_irqs(dsi, s);
return 0; return 0;
} }
#endif #endif
static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s) static int dsi_dump_dsi_regs(struct seq_file *s, void *p)
{ {
#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r)) struct dsi_data *dsi = p;
if (dsi_runtime_get(dsi)) if (dsi_runtime_get(dsi))
return; return 0;
dsi_enable_scp_clk(dsi); dsi_enable_scp_clk(dsi);
#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r))
DUMPREG(DSI_REVISION); DUMPREG(DSI_REVISION);
DUMPREG(DSI_SYSCONFIG); DUMPREG(DSI_SYSCONFIG);
DUMPREG(DSI_SYSSTATUS); DUMPREG(DSI_SYSSTATUS);
...@@ -1699,25 +1687,11 @@ static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s) ...@@ -1699,25 +1687,11 @@ static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s)
DUMPREG(DSI_PLL_GO); DUMPREG(DSI_PLL_GO);
DUMPREG(DSI_PLL_CONFIGURATION1); DUMPREG(DSI_PLL_CONFIGURATION1);
DUMPREG(DSI_PLL_CONFIGURATION2); DUMPREG(DSI_PLL_CONFIGURATION2);
#undef DUMPREG
dsi_disable_scp_clk(dsi); dsi_disable_scp_clk(dsi);
dsi_runtime_put(dsi); dsi_runtime_put(dsi);
#undef DUMPREG
}
static int dsi1_dump_regs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = dsi_get_dsi_from_id(0);
dsi_dump_dsi_regs(dsi, s);
return 0;
}
static int dsi2_dump_regs(struct seq_file *s, void *p)
{
struct dsi_data *dsi = dsi_get_dsi_from_id(1);
dsi_dump_dsi_regs(dsi, s);
return 0; return 0;
} }
...@@ -5305,6 +5279,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -5305,6 +5279,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
struct dsi_data *dsi; struct dsi_data *dsi;
struct resource *dsi_mem; struct resource *dsi_mem;
struct resource *res; struct resource *res;
char name[10];
dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
if (!dsi) if (!dsi)
...@@ -5443,23 +5418,13 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -5443,23 +5418,13 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
dsi_runtime_put(dsi); dsi_runtime_put(dsi);
if (dsi->module_id == 0) snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1);
dsi->debugfs.regs = dss_debugfs_create_file(dss, "dsi1_regs", dsi->debugfs.regs = dss_debugfs_create_file(dss, name,
dsi1_dump_regs, dsi_dump_dsi_regs, &dsi);
&dsi);
else
dsi->debugfs.regs = dss_debugfs_create_file(dss, "dsi2_regs",
dsi2_dump_regs,
&dsi);
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
if (dsi->module_id == 0) snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1);
dsi->debugfs.irqs = dss_debugfs_create_file(dss, "dsi1_irqs", dsi->debugfs.irqs = dss_debugfs_create_file(dss, name,
dsi1_dump_irqs, dsi_dump_dsi_irqs, &dsi);
&dsi);
else
dsi->debugfs.irqs = dss_debugfs_create_file(dss, "dsi2_irqs",
dsi2_dump_irqs,
&dsi);
#endif #endif
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment