Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 364d2db2 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab
Browse files

[media] au0828: Make the s_reg and g_reg advanced debug calls work against the bridge



The g_reg and s_reg calls worked properly if acting on subdev registers
(such as the au8522), but didn't work against the au0828 itself.  Copy
the logic over from em28xx.

Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 43f2cccf
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1717,8 +1717,12 @@ static int vidioc_g_register(struct file *file, void *priv,
		v4l2_device_call_all(&dev->v4l2_dev, 0, core, g_register, reg);
		return 0;
	default:
		if (!v4l2_chip_match_host(&reg->match))
			return -EINVAL;
	}

	reg->val = au0828_read(dev, reg->reg);
	return 0;
}

static int vidioc_s_register(struct file *file, void *priv,
@@ -1732,9 +1736,10 @@ static int vidioc_s_register(struct file *file, void *priv,
		v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_register, reg);
		return 0;
	default:
		if (!v4l2_chip_match_host(&reg->match))
			return -EINVAL;
	}
	return 0;
	return au0828_writereg(dev, reg->reg, reg->val);
}
#endif