Skip to content

Commit 198c653

Browse files
committed
Merge tag 'drm-misc-fixes-2025-01-02' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
drm-misc-fixes for v6.13-rc6: - Only fixes for adv7511 driver, including a use-after-free. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/f58429b7-5f11-4b78-b577-de32b41299ea@linux.intel.com
2 parents 48fc437 + 79d67c4 commit 198c653

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

Documentation/devicetree/bindings/display/bridge/adi,adv7533.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ properties:
9090
adi,dsi-lanes:
9191
description: Number of DSI data lanes connected to the DSI host.
9292
$ref: /schemas/types.yaml#/definitions/uint32
93-
enum: [ 1, 2, 3, 4 ]
93+
enum: [ 2, 3, 4 ]
9494

9595
"#sound-dai-cells":
9696
const: 0

drivers/gpu/drm/bridge/adv7511/adv7511_audio.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
153153
ADV7511_AUDIO_CFG3_LEN_MASK, len);
154154
regmap_update_bits(adv7511->regmap, ADV7511_REG_I2C_FREQ_ID_CFG,
155155
ADV7511_I2C_FREQ_ID_CFG_RATE_MASK, rate << 4);
156-
regmap_write(adv7511->regmap, 0x73, 0x1);
156+
157+
/* send current Audio infoframe values while updating */
158+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
159+
BIT(5), BIT(5));
160+
161+
regmap_write(adv7511->regmap, ADV7511_REG_AUDIO_INFOFRAME(0), 0x1);
162+
163+
/* use Audio infoframe updated info */
164+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
165+
BIT(5), 0);
157166

158167
return 0;
159168
}
@@ -184,8 +193,9 @@ static int audio_startup(struct device *dev, void *data)
184193
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(0),
185194
BIT(7) | BIT(6), BIT(7));
186195
/* use Audio infoframe updated info */
187-
regmap_update_bits(adv7511->regmap, ADV7511_REG_GC(1),
196+
regmap_update_bits(adv7511->regmap, ADV7511_REG_INFOFRAME_UPDATE,
188197
BIT(5), 0);
198+
189199
/* enable SPDIF receiver */
190200
if (adv7511->audio_source == ADV7511_AUDIO_SOURCE_SPDIF)
191201
regmap_update_bits(adv7511->regmap, ADV7511_REG_AUDIO_CONFIG,

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,10 @@ static int adv7511_probe(struct i2c_client *i2c)
12411241
return ret;
12421242

12431243
ret = adv7511_init_regulators(adv7511);
1244-
if (ret)
1245-
return dev_err_probe(dev, ret, "failed to init regulators\n");
1244+
if (ret) {
1245+
dev_err_probe(dev, ret, "failed to init regulators\n");
1246+
goto err_of_node_put;
1247+
}
12461248

12471249
/*
12481250
* The power down GPIO is optional. If present, toggle it from active to
@@ -1363,6 +1365,8 @@ static int adv7511_probe(struct i2c_client *i2c)
13631365
i2c_unregister_device(adv7511->i2c_edid);
13641366
uninit_regulators:
13651367
adv7511_uninit_regulators(adv7511);
1368+
err_of_node_put:
1369+
of_node_put(adv7511->host_node);
13661370

13671371
return ret;
13681372
}
@@ -1371,6 +1375,8 @@ static void adv7511_remove(struct i2c_client *i2c)
13711375
{
13721376
struct adv7511 *adv7511 = i2c_get_clientdata(i2c);
13731377

1378+
of_node_put(adv7511->host_node);
1379+
13741380
adv7511_uninit_regulators(adv7511);
13751381

13761382
drm_bridge_remove(&adv7511->bridge);

drivers/gpu/drm/bridge/adv7511/adv7533.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
172172

173173
of_property_read_u32(np, "adi,dsi-lanes", &num_lanes);
174174

175-
if (num_lanes < 1 || num_lanes > 4)
175+
if (num_lanes < 2 || num_lanes > 4)
176176
return -EINVAL;
177177

178178
adv->num_dsi_lanes = num_lanes;
@@ -181,8 +181,6 @@ int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv)
181181
if (!adv->host_node)
182182
return -ENODEV;
183183

184-
of_node_put(adv->host_node);
185-
186184
adv->use_timing_gen = !of_property_read_bool(np,
187185
"adi,disable-timing-generator");
188186

0 commit comments

Comments
 (0)