From: Philipp Zabel <p.zabel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/4] video: Add of_get_display_timing
Date: Thu, 30 Mar 2023 14:46:41 +0200 [thread overview]
Message-ID: <20230330124643.3562397-2-p.zabel@pengutronix.de> (raw)
In-Reply-To: <20230330124643.3562397-1-p.zabel@pengutronix.de>
Add a port of the kernel of_get_display_timing() that writes a
struct fb_videomode instead of struct display_timing, which we
don't have.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/video/of_display_timing.c | 22 ++++++++++++++++++++++
include/fb.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 6fe1e1b08b6a..6082d454932d 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -98,6 +98,28 @@ static int of_parse_display_timing(const struct device_node *np,
return 0;
}
+/**
+ * of_get_display_timing - parse a display_timing entry
+ * @np: device_node with the timing subnode
+ * @name: name of the timing node
+ * @mode: fb_videomode struct to fill
+ **/
+int of_get_display_timing(const struct device_node *np, const char *name,
+ struct fb_videomode *mode)
+{
+ struct device_node *timing_np;
+
+ if (!np)
+ return -EINVAL;
+
+ timing_np = of_get_child_by_name(np, name);
+ if (!timing_np)
+ return -ENOENT;
+
+ return of_parse_display_timing(timing_np, mode);
+}
+EXPORT_SYMBOL_GPL(of_get_display_timing);
+
/**
* of_get_display_timings - parse all display_timing entries from a device_node
* @np: device_node with the subnodes
diff --git a/include/fb.h b/include/fb.h
index bf5f688342fd..15bb74b99576 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -147,6 +147,8 @@ struct fb_info {
int shadowfb;
};
+int of_get_display_timing(const struct device_node *np, const char *name,
+ struct fb_videomode *mode);
struct display_timings *of_get_display_timings(struct device_node *np);
void display_timings_release(struct display_timings *);
--
2.39.2
next prev parent reply other threads:[~2023-03-30 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 12:46 [PATCH v2 1/4] firmware: Add request/release_firmware() calls Philipp Zabel
2023-03-30 12:46 ` Philipp Zabel [this message]
2023-03-30 12:46 ` [PATCH v2 3/4] video: add MIPI DBI framebuffer helpers Philipp Zabel
2023-03-30 12:46 ` [PATCH v2 4/4] video: Add MIPI DBI compatible SPI driver Philipp Zabel
2023-04-03 7:03 ` [PATCH v2 1/4] firmware: Add request/release_firmware() calls Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230330124643.3562397-2-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox