Skip to contentSkip to conversation

cx25840: Fix subdev registration in cx25840-core.c

PATCH Superseded Igor M. Liplianin 1 participant 1 message Jan 1, 2011 Media (V4L/DVB)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 14/18 cx25840: Fix subdev registration in cx25840-core.c

On my system, cx23885 based card reports default volume value above 70000. So, register cx25840 subdev fails. Although, the card don't have a/v inputs it needs a/v firmware to be loaded.

---
 drivers/media/video/cx25840/cx25840-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/media/video/cx25840/cx25840-core.c +2 -0
index dfb198d..dc0cec7 100644
@@ -1991,6 +1991,8 @@ static int cx25840_probe(struct i2c_client *client,
 	if (!is_cx2583x(state)) {
 		default_volume = 228 - cx25840_read(client, 0x8d4);
 		default_volume = ((default_volume / 2) + 23) << 9;
+		if (default_volume > 65535)
+			default_volume = 65535;
 
 		state->volume = v4l2_ctrl_new_std(&state->hdl,
 			&cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME,
Signature · 1 line
1.7.1