[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241127103031.1007893-3-andrej.picej@norik.com>
Date: Wed, 27 Nov 2024 11:30:30 +0100
From: Andrej Picej <andrej.picej@...ik.com>
To: andrzej.hajda@...el.com,
neil.armstrong@...aro.org,
rfoss@...nel.org,
Laurent.pinchart@...asonboard.com,
jonas@...boo.se,
jernej.skrabec@...il.com,
airlied@...il.com,
simona@...ll.ch,
maarten.lankhorst@...ux.intel.com,
mripard@...nel.org,
tzimmermann@...e.de,
robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de,
festevam@...il.com,
marex@...x.de
Cc: dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 2/3] drm/bridge: ti-sn65dsi83: Add ti,lvds-vcom as optional property
From: Janine Hagemann <j.hagemann@...tec.de>
Add a optional property to change LVDS output voltage. This should not
be static as this depends mainly on the connected display voltage
requirement.
If the property is not present, the default value of 0x05 is used.
Signed-off-by: Janine Hagemann <j.hagemann@...tec.de>
Signed-off-by: Andrej Picej <andrej.picej@...ik.com>
---
drivers/gpu/drm/bridge/ti-sn65dsi83.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
index 57a7ed13f996..d6824f6501b6 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
@@ -147,6 +147,7 @@ struct sn65dsi83 {
struct regulator *vcc;
bool lvds_dual_link;
bool lvds_dual_link_even_odd_swap;
+ u32 lvds_vcom;
};
static const struct regmap_range sn65dsi83_readable_ranges[] = {
@@ -435,7 +436,7 @@ static void sn65dsi83_atomic_pre_enable(struct drm_bridge *bridge,
val |= REG_LVDS_FMT_LVDS_LINK_CFG;
regmap_write(ctx->regmap, REG_LVDS_FMT, val);
- regmap_write(ctx->regmap, REG_LVDS_VCOM, 0x05);
+ regmap_write(ctx->regmap, REG_LVDS_VCOM, ctx->lvds_vcom);
regmap_write(ctx->regmap, REG_LVDS_LANE,
(ctx->lvds_dual_link_even_odd_swap ?
REG_LVDS_LANE_EVEN_ODD_SWAP : 0) |
@@ -580,6 +581,13 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
{
struct drm_bridge *panel_bridge;
struct device *dev = ctx->dev;
+ struct device_node *endpoint;
+
+ ctx->lvds_vcom = 0x05;
+
+ endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, 0);
+ of_property_read_u32(endpoint, "ti,lvds-vcom", &ctx->lvds_vcom);
+ of_node_put(endpoint);
ctx->lvds_dual_link = false;
ctx->lvds_dual_link_even_odd_swap = false;
--
2.34.1
Powered by blists - more mailing lists