Thread (6 messages) 6 messages, 2 authors, 2024-08-16

[PATCH v4 2/2] media: aspeed: Allow to capture from SoC display (GFX)

From: Jammy Huang <hidden>
Date: 2024-08-16 02:31:48
Also in: linux-arm-kernel, linux-media, lkml, openbmc

Hi Krzysztof,

On 2024/8/14 ?? 02:09, Krzysztof Kozlowski wrote:
On 14/08/2024 02:54, Jammy Huang wrote:
quoted
+/*
+ * Get regmap without checking res, such as clk/reset, that could
+lead to
+ * conflict.
+ */
+static struct regmap *aspeed_regmap_lookup(struct device_node *np,
+const char *property) {
+   struct device_node *syscon_np __free(device_node) =
of_parse_phandle(np, property, 0);
quoted
+   struct regmap *regmap;
Drop. The point of using __free was to make this very simple.
To be simpler, it will looks like this, right.

+       struct device_node *syscon_np __free(device_node) = of_parse_phandle(np, property, 0);
+
+       if (!syscon_np)
+               return ERR_PTR(-ENODEV);
+       return device_node_to_regmap(syscon_np);
quoted
+
+   if (!syscon_np)
+           return ERR_PTR(-ENODEV);
+
+   regmap = device_node_to_regmap(syscon_np);
+
+   return regmap;
+}
+
 static int aspeed_video_init(struct aspeed_video *video)  {
    int irq;
    int rc;
    struct device *dev = video->dev;

+   video->scu = aspeed_regmap_lookup(dev->of_node, "aspeed,scu");
+   video->gfx = aspeed_regmap_lookup(dev->of_node, "aspeed,gfx");
Still undocumented. Respond to previous comment and confirm that you
understood it.
Sorry for misunderstanding. I will add document,
Documentation/devicetree/bindings/arm/aspeed/aspeed,video.yaml, later.

Best regards,
Krzysztof
************* Email Confidentiality Notice ********************
????:
???(????)????????????????? ???????????????????????????, ??????????????????????????????!

DISCLAIMER:
This message (and any attachments) may contain legally privileged and/or other confidential information. If you have received it in error, please notify the sender by reply e-mail and immediately delete the e-mail and any attachments without copying or disclosing the contents. Thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help