media: hws: fix device info register field masks
Subsystems (2)
Ben Hoff
maintainerPATCH 1/1 media: hws: fix device info register field masks
The baseline driver decodes the device version from bits 15:8 and the sub-version from bits 23:16 of HWS_REG_DEVICE_INFO. The current masks decode both fields one byte too low, reading the device version from a byte the baseline driver ignores and the sub-version from the device version field.
hws_configure_hardware_capabilities() uses the device version to classify the hardware generation. An incorrect version can classify newer hardware as legacy, select the legacy capture path, and skip HWS_REG_DMA_MAX_SIZE programming.
Correct both field masks and update the register layout documentation.
Signed-off-by Ben Hoff <[email protected]>
--- drivers/media/pci/hws/hws_pci.c | 4 ++-- drivers/media/pci/hws/hws_reg.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/media/pci/hws/hws_pci.c +2 -2
@@ -33,8 +33,8 @@ static unsigned long long hws_elapsed_us(u64 start_ns) }/* register layout inside HWS_REG_DEVICE_INFO */ -#define DEVINFO_VER GENMASK(7, 0) -#define DEVINFO_SUBVER GENMASK(15, 8) +#define DEVINFO_VER GENMASK(15, 8) +#define DEVINFO_SUBVER GENMASK(23, 16)#define DEVINFO_YV12 GENMASK(31, 28)#define DEVINFO_HWKEY GENMASK(27, 24)#define DEVINFO_PORTID GENMASK(25, 24)/* low 2 bits of HW-key */
drivers/media/pci/hws/hws_reg.h +4 -3
@@ -121,9 +121,10 @@#define HWS_REG_DEVICE_INFO (CVBS_IN_BASE + 88 * PCIE_BARADDROFSIZE)/* * Reading this 32-bit word returns: -* bits 7:0 = "device version" -* bits 15:8 = "device sub-version" -* bits 23:24 = "HW key / port ID" etc. +* bits 7:0 = unused by the baseline driver +* bits 15:8 = device version +* bits 23:16 = device sub-version +* bits 27:24 = HW key (port ID in bits 25:24) * bits 31:28 = "support YV12" flags */
Signature · 1 line
2.43.0